[1m[36m (0.3ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- 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 [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------- 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 [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.3ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------ 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 [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------- RoolerTest: test_truth ---------------------- [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.3ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------- RoolerTest: test_truth ---------------------- [1m[35m (0.1ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (11.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.8ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.0ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------- RoolerTest: test_truth ---------------------- [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.5ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_for_objects_matching_rule ------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_rules" [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m 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 [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.0ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.1ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------- RoolerTest: test_truth ---------------------- [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (2.0ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.3ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_for_objects_matching_rule ------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.8ms)[0m SELECT COUNT(*) FROM "rooler_rules" [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.8ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.4ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.8ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------- RoolerTest: test_truth ---------------------- [1m[35m (0.4ms)[0m ROLLBACK [1m[36m (0.3ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (8.3ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_for_objects_matching_rule ------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_rules" [1m[36mRooler::Rule Load (0.3ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_rules"[0m [1m[35m (0.6ms)[0m ROLLBACK [1m[36m (0.3ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.2ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------- RoolerTest: test_truth ---------------------- [1m[35m (0.1ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_for_objects_matching_rule ------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.7ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.5ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.2ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------- RoolerTest: test_truth ---------------------- [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.5ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.8ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_for_objects_matching_rule ------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.5ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.0ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.2ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------- RoolerTest: test_truth ---------------------- [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.5ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_for_objects_matching_rule ------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.3ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.0ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------- RoolerTest: test_truth ---------------------- [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_for_objects_matching_rule ------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.0ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------- RoolerTest: test_truth ---------------------- [1m[35m (0.1ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.6ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (2.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.3ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.3ms)[0m [1mBEGIN[0m ------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_for_objects_matching_rule ------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.8ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.3ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.3ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------- RoolerTest: test_truth ---------------------- [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.5ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_for_objects_matching_rule ------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.7ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.2ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.3ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36m (0.5ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.8ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.2ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------- RoolerTest: test_truth ---------------------- [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.8ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_for_objects_matching_rule ------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.2ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.3ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35m (0.5ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.8ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------- RoolerTest: test_truth ---------------------- [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_for_objects_matching_rule ------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.6ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.7ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35m (0.3ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------- RoolerTest: test_truth ---------------------- [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.3ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.3ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_for_objects_matching_rule ------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.3ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (2.2ms)[0m 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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.7ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.7ms)[0m [1mSELECT 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[0m [1m[35m (0.3ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.8ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN ---------------------- RoolerTest: test_truth ---------------------- [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.4ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.8ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_for_objects_matching_rule ------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.0ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.1ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.3ms)[0m [1mBEGIN[0m ---------------------- RoolerTest: test_truth ---------------------- [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.8ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_for_objects_matching_rule ------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.7ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.3ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35m (0.5ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.1ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN ---------------------- RoolerTest: test_truth ---------------------- [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.3ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_rule ------------------------------------------------------------------------ [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.7ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.3ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35m (0.3ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.3ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.2ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------- RoolerTest: test_truth ---------------------- [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.6ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.7ms)[0m 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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.6ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35m (0.5ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36m (0.2ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.9ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------- RoolerTest: test_truth ---------------------- [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.3ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.3ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.3ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35m (0.3ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.6ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36m (0.2ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------- RoolerTest: test_truth ---------------------- [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.5ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (2.1ms)[0m 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 [1m[36mSQL (1.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.7ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.3ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.3ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36m (0.2ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35m (0.2ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.3ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ---------------------- RoolerTest: test_truth ---------------------- [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.3ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.9ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (1.7ms)[0m 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) [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (14.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.2ms)[0m 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 [1m[36mSQL (1.3ms)[0m [1mSELECT "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)[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.3ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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 [1m[36mSQL (0.8ms)[0m [1mSELECT "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[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mSQL (0.8ms)[0m 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) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mSQL (0.7ms)[0m 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) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.6ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36m (0.3ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.9ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.2ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------- RoolerTest: test_truth ---------------------- [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.3ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (2.1ms)[0m 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) [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (1.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.9ms)[0m 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 [1m[36mSQL (0.8ms)[0m [1mSELECT "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)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.4ms)[0m 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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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 [1m[36mSQL (1.0ms)[0m [1mSELECT "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[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mSQL (0.8ms)[0m 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) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mSQL (0.7ms)[0m [1mSELECT "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)[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36m (0.5ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.9ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------- RoolerTest: test_truth ---------------------- [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (1.8ms)[0m 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) [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (1.1ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mSELECT "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)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mSELECT "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[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mSQL (0.7ms)[0m 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) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mSQL (0.7ms)[0m [1mSELECT "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)[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36m (0.5ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.9ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.1ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------- RoolerTest: test_truth ---------------------- [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (8.4ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.9ms)[0m 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))) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m 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))) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.2ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36m (0.3ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.5ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.4ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.4ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.1ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.6ms)[0m ROLLBACK [1m[36m (0.7ms)[0m [1mBEGIN[0m ---------------------- RoolerTest: test_truth ---------------------- [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.3ms)[0m 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)))) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.2ms)[0m [1mSELECT "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[0m [1m[35mRooler::Rule Load (0.7ms)[0m 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)))) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (1.3ms)[0m 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 [1m[36mSQL (1.2ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "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[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.7ms)[0m 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)))) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (1.0ms)[0m 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)))) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "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))))[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36m (0.3ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.0ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.1ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------- RoolerTest: test_truth ---------------------- [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.7ms)[0m 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)))) [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.3ms)[0m [1mSELECT "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[0m [1m[35mRooler::Rule Load (0.8ms)[0m 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 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (1.1ms)[0m 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 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.8ms)[0m [1mSELECT "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))))[0m [1m[35m (0.4ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.8ms)[0m [1mSELECT "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))))[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.7ms)[0m 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)))) [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35m (0.4ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.7ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------- RoolerTest: test_truth ---------------------- [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.4ms)[0m 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)))) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.4ms)[0m [1mSELECT "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[0m [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.7ms)[0m 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)))) [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.8ms)[0m 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)))) [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "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))))[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36m (0.3ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.1ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------- RoolerTest: test_truth ---------------------- [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (10.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (2.0ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (1.2ms)[0m [1mSELECT "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))))[0m [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.7ms)[0m 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)))) [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35m (0.2ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ---------------------- RoolerTest: test_truth ---------------------- [1m[36m (0.1ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.5ms)[0m 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)))) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.3ms)[0m [1mSELECT "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[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.1ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "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))))[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.7ms)[0m 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)))) [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35m (0.3ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------- RoolerTest: test_truth ---------------------- [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (2.7ms)[0m 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)))) [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.3ms)[0m [1mSELECT "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[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.1ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.7ms)[0m 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)))) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.7ms)[0m 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)))) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "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))))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36m (0.4ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.0ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------- RoolerTest: test_truth ---------------------- [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (8.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (2.9ms)[0m 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)))) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.4ms)[0m [1mSELECT "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[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.6ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (1.2ms)[0m [1mSELECT "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))))[0m [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.7ms)[0m 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)))) [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35m (0.3ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------- RoolerTest: test_truth ---------------------- [1m[36m (0.1ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.9ms)[0m 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)))) [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.2ms)[0m [1mSELECT "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[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.2ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.7ms)[0m 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)))) [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "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))))[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.3ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.8ms)[0m [1mSELECT "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))))[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.9ms)[0m 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)))) [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35m (0.2ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------- RoolerTest: test_truth ---------------------- [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (2.6ms)[0m 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)))) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.2ms)[0m [1mSELECT "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[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (50.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "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))))[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.2ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.7ms)[0m 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)))) [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35m (0.3ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------- RoolerTest: test_truth ---------------------- [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.4ms)[0m 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)))) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.2ms)[0m [1mSELECT "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[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.3ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.8ms)[0m 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)))) [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.7ms)[0m 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)))) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "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))))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36m (0.3ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------- RoolerTest: test_truth ---------------------- [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.2ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.2ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36m (0.3ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------- RoolerTest: test_truth ---------------------- [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.8ms)[0m 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' [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.6ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (1.1ms)[0m 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 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35m (0.4ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.1ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------- RoolerTest: test_truth ---------------------- [1m[36m (0.1ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (37.5ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.6ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.2ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36m (0.3ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.2ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------- RoolerTest: test_truth ---------------------- [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.4ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.8ms)[0m 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' [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.6ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (1.4ms)[0m 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 [1m[36mSQL (1.2ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.6ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35m (0.2ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.2ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------- RoolerTest: test_truth ---------------------- [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (1.6ms)[0m SELECT "rooler_deliveries"."id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 247]] [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.1ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.4ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36m (0.3ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.9ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------- RoolerTest: test_truth ---------------------- [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (1.5ms)[0m SELECT "rooler_deliveries"."id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 254]] [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.3ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36m (0.3ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------- RoolerTest: test_truth ---------------------- [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (1.6ms)[0m SELECT "rooler_deliveries"."id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 261]] [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 262]] [1m[35mRooler::Rule Load (0.3ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36m (0.2ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------- RoolerTest: test_truth ---------------------- [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.5ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (1.4ms)[0m SELECT "rooler_deliveries"."id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 268]] [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 269]] [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.3ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36m (0.5ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.0ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------- RoolerTest: test_truth ---------------------- [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.3ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.3ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (1.6ms)[0m SELECT "rooler_deliveries"."id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 275]] [1m[36mRooler::Rule Load (0.8ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.9ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 276]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 277]] [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.7ms)[0m 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 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 277]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36m (0.2ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35m (0.3ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.1ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------- RoolerTest: test_truth ---------------------- [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (1.5ms)[0m [1mSELECT "rooler_deliveries"."id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 283]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.9ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 284]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.1ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 283]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 285]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 285]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36m (0.3ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35m (0.2ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------- RoolerTest: test_truth ---------------------- [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (2.6ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 291]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.9ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 292]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.0ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 291]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.3ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 293]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.3ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 293]] [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35m (0.3ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.2ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------- RoolerTest: test_truth ---------------------- [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (11.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (2.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (1.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (1.0ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (4.9ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (1.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 299]] [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (NULL))[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.3ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.2ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.6ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (1.0ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 300]] [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (NULL)) [1m[36m (0.7ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.6ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (1.3ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.7ms)[0m [1mSELECT 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[0m [1m[35m (0.2ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.1ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.3ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------- RoolerTest: test_truth ---------------------- [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.2ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.9ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.1ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36m (0.5ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------- RoolerTest: test_truth ---------------------- [1m[35m (0.1ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (1.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 313]] [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (NULL))[0m [1m[35m (0.4ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 314]] [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (NULL)) [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35m (0.4ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ---------------------- RoolerTest: test_truth ---------------------- [1m[36m (0.1ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (1.6ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 320]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 321]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36m (0.2ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.1ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------- RoolerTest: test_truth ---------------------- [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (1.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 327]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 328]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.8ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36m (0.3ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------- RoolerTest: test_truth ---------------------- [1m[35m (0.1ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (1.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 334]] [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (NULL))[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.3ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 335]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (NULL)) [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.7ms)[0m 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 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35m (0.5ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------- RoolerTest: test_truth ---------------------- [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (1.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 341]] [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 342]] [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 343]] [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 343]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (343)) [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35m (0.3ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------- RoolerTest: test_truth ---------------------- [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (1.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 349]] [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 350]] [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36m (0.2ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.7ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.6ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.5ms)[0m ROLLBACK [1m[36m (0.4ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------- RoolerTest: test_truth ---------------------- [1m[35m (0.5ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (1.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 356]] [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 357]] [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.3ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.6ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 358]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (1.3ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 358]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (358)) [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.3ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35m (0.3ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------- RoolerTest: test_truth ---------------------- [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.5ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (2.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 364]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 365]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 364]] [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (365))[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 366]] [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 366]] [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (366)) [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35m (0.3ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN ---------------------- RoolerTest: test_truth ---------------------- [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.5ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.5ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (2.2ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 372]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 373]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.8ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36m (0.5ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------- RoolerTest: test_truth ---------------------- [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (1.6ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 379]] [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 380]] [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.0ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.4ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 379]] [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (380))[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 381]] [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 381]] [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (381)) [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35m (0.3ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------- RoolerTest: test_truth ---------------------- [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (2.0ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 387]] [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 388]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 387]] [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (388))[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 389]] [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 389]] [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (389)) [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35m (0.2ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------- RoolerTest: test_truth ---------------------- [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (1.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 395]] [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 396]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 395]] [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (396))[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 397]] [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 397]] [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (397)) [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35m (0.4ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------- RoolerTest: test_truth ---------------------- [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (2.1ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 403]] [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 404]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.7ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 403]] [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (404))[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 405]] [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 405]] [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (405)) [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35m (0.6ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------- RoolerTest: test_truth ---------------------- [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (10.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (1.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 411]] [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 412]] [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 411]] [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (412))[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.3ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 413]] [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 413]] [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (413)) [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35m (0.3ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------- RoolerTest: test_truth ---------------------- [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (42.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.5ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (1.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 419]] [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 420]] [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.3ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 419]] [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (420))[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 421]] [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 421]] [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (421)) [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35m (0.4ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.2ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------- RoolerTest: test_truth ---------------------- [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.2ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.1ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.9ms)[0m INSERT 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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (15.4ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36m (0.5ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.6ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 428]] [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 429]] [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 428]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (429)) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 430]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 430]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (430))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36m (0.4ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.9ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (42.8ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.5ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------- RoolerTest: test_truth ---------------------- [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.0ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.8ms)[0m INSERT 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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (4.0ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.8ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 437]] [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 438]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 437]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (438)) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.7ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 439]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 439]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (439))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36m (0.3ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.9ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.1ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------- RoolerTest: test_truth ---------------------- [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 446]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 447]] [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 446]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (447)) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 448]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 448]] [1m[36mRooler::Rule Load (0.3ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (448))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36m (0.3ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (2.1ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.1ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------- RoolerTest: test_truth ---------------------- [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.1ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.3ms)[0m INSERT 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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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: [1m[36m (0.5ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (1.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 455]] [1m[35mRooler::Rule Load (1.0ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 456]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 455]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (456)) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 457]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 457]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (457))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36m (0.3ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.2ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------- RoolerTest: test_truth ---------------------- [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.4ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.1ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.0ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 #<Rooler::Rule:0x007f819e881248>@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 #<Rooler::Rule:0x007f819e881248>@to.com cc: Liquid error: undefined method `to_liquid' for #<Rooler::Rule:0x007f819e881248>@cc.com Message-ID: <530f23ba52880_301a3fc0cd835ae08046@Yonahs-MacBook-Pro.local.mail> Subject: subject is: Liquid error: undefined method `to_liquid' for #<Rooler::Rule:0x007f819e881248> Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: Liquid error: undefined method `to_liquid' for #<Rooler::Rule:0x007f819e881248> [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.8ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 464]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 465]] [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 464]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (465)) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 466]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 466]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (466))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36m (0.5ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.1ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------- RoolerTest: test_truth ---------------------- [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.1ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.6ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.7ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.6ms)[0m 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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (1.0ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 473]] [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 474]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 473]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (474)) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 475]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 475]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (475))[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36m (0.3ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.0ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------- RoolerTest: test_truth ---------------------- [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.2ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.9ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 482]] [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 483]] [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 482]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (483)) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 484]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 484]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (484))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36m (0.3ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.1ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.2ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.1ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.9ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 492]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 493]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 492]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (493)) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 494]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 494]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (494))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36m (0.3ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.2ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[36m (0.3ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (8.4ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.5ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.8ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.2ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.5ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 502]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 503]] [1m[35mRooler::Rule Load (0.7ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 502]] [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (503)) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 504]] [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.9ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.6ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 504]] [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (504))[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36m (0.3ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.8ms)[0m ROLLBACK [1m[36m (0.4ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.8ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.5ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 513]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 514]] [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.7ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 513]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (514)) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 515]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 515]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (515))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36m (0.3ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.6ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m 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())) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "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()))[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "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()))[0m [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 521]] [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (9.2ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.1ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.9ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 524]] [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 525]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 524]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (525)) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 526]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.9ms)[0m INSERT 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 526]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (526))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36m (0.3ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m 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())) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "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()))[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (1.1ms)[0m [1mSELECT "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()))[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 532]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.4ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m INSERT 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.8ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 535]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') [1m[36m (1.0ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 536]] [1m[35mRooler::Rule Load (0.7ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 535]] [1m[35mRooler::Rule Load (0.7ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (536)) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 537]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.8ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 537]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (537))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.5ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36m (0.3ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.3ms)[0m 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())) [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "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()))[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "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()))[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 543]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.5ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mRooler::Rule Load (0.9ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 543]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.5ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.2ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.0ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 546]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 547]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 546]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (547)) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 548]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 548]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (548))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.5ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36m (0.2ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.6ms)[0m 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())) [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "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()))[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.0ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 554]] [1m[35mRooler::Rule Load (0.8ms)[0m 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 [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.6ms)[0m 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())) [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 556]] [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["id", 556]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.3ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.0ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (3.5ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.7ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 559]] [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 560]] [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 559]] [1m[35mRooler::Rule Load (0.7ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (560)) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 561]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.6ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 561]] [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (561))[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.8ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36m (0.3ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.3ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.6ms)[0m 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())) [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "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()))[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.3ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 567]] [1m[35mRooler::Rule Load (0.9ms)[0m 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 [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.6ms)[0m 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())) [1m[36m (0.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 569]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.5ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["id", 569]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.0ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.2ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.7ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 572]] [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 573]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 572]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (573)) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 574]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 574]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (574))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36m (0.3ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.0ms)[0m 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())) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "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()))[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.3ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.5ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 580]] [1m[35mRooler::Rule Load (0.8ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-02-27 12:36:10.697654' WHERE "rooler_deliveries"."id" = 185[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "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()))[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 582]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 582]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.3ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 585]] [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 586]] [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 585]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (586)) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 587]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.5ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 587]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (587))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36m (0.2ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.6ms)[0m 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())) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.1ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "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()))[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 593]] [1m[35mRooler::Rule Load (0.8ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-02-27 12:37:51.017696' WHERE "rooler_deliveries"."id" = 191[0m [1m[35mRooler::Delivery Load (0.7ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 191]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m 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())) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 595]] [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["id", 595]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (22.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.1ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.3ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.0ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.7ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.8ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 597[0m [["rule_id", 597]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.7ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 598]] [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 599]] [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 598]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (599)) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 600]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 600]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (600))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.7ms)[0m 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]] [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.5ms)[0m 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]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "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()))[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.6ms)[0m 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())) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.8ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (0.6ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-02-27 14:27:28.341450' WHERE "rooler_deliveries"."id" = 197 [1m[36mRooler::Delivery Load (0.8ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 197]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "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()))[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 607]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 607]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (20.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.5ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.8ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 609[0m [["rule_id", 609]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.7ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 610]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 611]] [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.6ms)[0m 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]] [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 610]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (611)) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 612]] [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.5ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 612]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (612))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.7ms)[0m 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]] [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m 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]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "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()))[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m 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())) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.8ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (1.2ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-02-27 15:01:53.871408' WHERE "rooler_deliveries"."id" = 203 [1m[36mRooler::Delivery Load (0.9ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 203]] [1m[35m (0.4ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "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()))[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 619]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 619]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.3ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.7ms)[0m INSERT 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (1.2ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 621[0m [["rule_id", 621]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.7ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 622]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 623]] [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 622]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (623)) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 624]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 624]] [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (624))[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 625[0m [["rule_id", 625]] [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.0ms)[0m 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())) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "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()))[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.5ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.6ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.9ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 630]] [1m[35mRooler::Rule Load (1.0ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-02-27 15:02:18.971025' WHERE "rooler_deliveries"."id" = 209[0m [1m[35mRooler::Delivery Load (0.7ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 209]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m 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())) [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 632]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.5ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["id", 632]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (8.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (1.4ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.8ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.4ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.6ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.8ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 634[0m [["rule_id", 634]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.6ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 635]] [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 636]] [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 635]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (636)) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 637]] [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 637]] [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (637))[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 638[0m [["rule_id", 638]] [1m[35m (0.7ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.0ms)[0m 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())) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "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()))[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.9ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 643]] [1m[35mRooler::Rule Load (1.0ms)[0m 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 [1m[36mSQL (0.8ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-02-27 15:02:55.150888' WHERE "rooler_deliveries"."id" = 215[0m [1m[35mRooler::Delivery Load (1.0ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 215]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.6ms)[0m 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())) [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 645]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["id", 645]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (31.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.3ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.9ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.8ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 647[0m [["rule_id", 647]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.9ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 648]] [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 649]] [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 648]] [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (649)) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 650]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 650]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (650))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 651[0m [["rule_id", 651]] [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.9ms)[0m 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]] [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.0ms)[0m 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())) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (8.8ms)[0m [1mSELECT "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()))[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.3ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "instance_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 656]] [1m[35mRooler::Rule Load (0.8ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-13 10:16:54.924131' WHERE "rooler_deliveries"."id" = 221[0m [1m[35mRooler::Delivery Load (0.7ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 221]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m 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())) [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 658]] [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["id", 658]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (331.5ms)[0m [1mDROP DATABASE IF EXISTS "dummy_test"[0m [1m[35m (768.1ms)[0m CREATE DATABASE "dummy_test" ENCODING = 'utf8' [1m[36mSQL (3.7ms)[0m [1mCREATE EXTENSION IF NOT EXISTS "plpgsql"[0m [1m[35m (9.0ms)[0m 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) [1m[36m (8.0ms)[0m [1mCREATE 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)) [0m [1m[35m (7.6ms)[0m 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) [1m[36m (1.4ms)[0m [1mCREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL) [0m [1m[35m (2.1ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version") [1m[36m (0.6ms)[0m [1mSELECT version FROM "schema_migrations"[0m [1m[35m (1.0ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20140313103833') [1m[36m (0.7ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20140226113304')[0m [1m[35m (0.5ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20140226113305') [1m[36m (0.5ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20140226120455')[0m [1m[35mActiveRecord::SchemaMigration Load (0.5ms)[0m SELECT "schema_migrations".* FROM "schema_migrations" [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.2ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.6ms)[0m INSERT 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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.9ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.5ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.9ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 2[0m [["rule_id", 2]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.7ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 3]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 4]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.3ms)[0m [1mSELECT "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()))[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m 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())) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.5ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (1.4ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (0.6ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-13 11:10:55.956434' WHERE "rooler_deliveries"."id" = 2 [1m[36mRooler::Delivery Load (0.7ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 2]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "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()))[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 11]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (8.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.1ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.6ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (1.2ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 13[0m [["rule_id", 13]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (1.2ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 14]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 15]] [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 14]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (15)) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 16]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 16]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (16))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.7ms)[0m 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]] [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 17[0m [["rule_id", 17]] [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.0ms)[0m 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())) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "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()))[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 22]] [1m[35mRooler::Rule Load (0.9ms)[0m 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 [1m[36mSQL (1.2ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-13 11:33:00.013549' WHERE "rooler_deliveries"."id" = 7[0m [1m[35mRooler::Delivery Load (0.8ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 7]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m 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())) [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 24]] [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["id", 24]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.3ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (3.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.7ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (1.2ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 26[0m [["rule_id", 26]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.7ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 27]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 28]] [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 27]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (28)) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN --------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method_with_params --------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 29]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 31]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 31]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (31))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.7ms)[0m 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]] [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 32[0m [["rule_id", 32]] [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.0ms)[0m 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())) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "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()))[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.5ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.9ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 37]] [1m[35mRooler::Rule Load (0.9ms)[0m 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 [1m[36mSQL (0.9ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-13 11:36:34.275495' WHERE "rooler_deliveries"."id" = 13[0m [1m[35mRooler::Delivery Load (0.7ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 13]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m 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())) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 39]] [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["id", 39]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (10.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.3ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m INSERT 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.7ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.8ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 41[0m [["rule_id", 41]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.8ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 42]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 43]] [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 42]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (43)) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method_with_params --------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 44]] [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') LIMIT 2 [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 46]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 46]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (46))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.7ms)[0m 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]] [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.8ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 47[0m [["rule_id", 47]] [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.0ms)[0m 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())) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "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()))[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 52]] [1m[35mRooler::Rule Load (0.8ms)[0m 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 [1m[36mSQL (1.2ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-13 11:36:53.528148' WHERE "rooler_deliveries"."id" = 19[0m [1m[35mRooler::Delivery Load (1.1ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 19]] [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m 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())) [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 54]] [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["id", 54]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.8ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.3ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.8ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 56[0m [["rule_id", 56]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.6ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 57]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 58]] [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.7ms)[0m 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]] [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.8ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 57]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (58)) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method_with_params --------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 59]] [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 61]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 61]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (61))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.7ms)[0m 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]] [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 62[0m [["rule_id", 62]] [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.5ms)[0m 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())) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.2ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.8ms)[0m [1mSELECT "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()))[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 67]] [1m[35mRooler::Rule Load (0.9ms)[0m 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 [1m[36mSQL (0.8ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-13 11:37:09.173868' WHERE "rooler_deliveries"."id" = 25[0m [1m[35mRooler::Delivery Load (1.2ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 25]] [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m 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())) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 69]] [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.5ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["id", 69]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.0ms)[0m INSERT 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (3.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.6ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.8ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 71[0m [["rule_id", 71]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.7ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 72]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 73]] [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 72]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (73)) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN --------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method_with_params --------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 74]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 76]] [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m INSERT 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 76]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (76))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.7ms)[0m 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]] [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 77[0m [["rule_id", 77]] [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.6ms)[0m 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]] [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.0ms)[0m 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())) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "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()))[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 82]] [1m[35mRooler::Rule Load (0.9ms)[0m 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 [1m[36mSQL (1.1ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-13 12:01:55.829779' WHERE "rooler_deliveries"."id" = 31[0m [1m[35mRooler::Delivery Load (1.0ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 31]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m 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())) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule'[0m [["rule_id", 84]] [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["id", 84]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (26.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.7ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.8ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 86[0m [["rule_id", 86]] [1m[35m (0.7ms)[0m 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' [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 87]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method_with_params --------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 88]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 90]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 91[0m [["rule_id", 91]] [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.7ms)[0m 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]] [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.0ms)[0m 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())) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "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()))[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 96]] [1m[35mRooler::Rule Load (0.8ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 10:34:38.638150' WHERE "rooler_deliveries"."id" = 35[0m [1m[35mRooler::Delivery Load (0.8ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 35]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m 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())) [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 98]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.2ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.0ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.1ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.7ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 100[0m [["rule_id", 100]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.7ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 101]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN --------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method_with_params --------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 102]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 104]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 105[0m [["rule_id", 105]] [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.5ms)[0m 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]] [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 106[0m [["rule_id", 106]] [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "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()))[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m 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())) [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (0.7ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 10:36:23.161917' WHERE "rooler_deliveries"."id" = 38 [1m[36mRooler::Delivery Load (0.8ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 38]] [1m[35m (0.4ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "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()))[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 112]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.8ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.8ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.6ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.6ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (1.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 114[0m [["rule_id", 114]] [1m[35m (0.4ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.6ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 115]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN --------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method_with_params --------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 116]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 118]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 119[0m [["rule_id", 119]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.5ms)[0m 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]] [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 120[0m [["rule_id", 120]] [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "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()))[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m 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())) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.8ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (1.0ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 10:42:47.131493' WHERE "rooler_deliveries"."id" = 41 [1m[36mRooler::Delivery Load (0.9ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 41]] [1m[35m (0.4ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "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()))[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 126]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.2ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.6ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.7ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.8ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 128[0m [["rule_id", 128]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.6ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 129]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method_with_params --------------------------------------------------------------------------------------------------------------- [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 130]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 132]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 133[0m [["rule_id", 133]] [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m 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]] [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 134[0m [["rule_id", 134]] [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "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()))[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.7ms)[0m 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())) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (1.0ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (1.0ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 10:43:40.096255' WHERE "rooler_deliveries"."id" = 44 [1m[36mRooler::Delivery Load (1.3ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 44]] [1m[35m (0.5ms)[0m ROLLBACK [1m[36m (0.4ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "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()))[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 140]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (13.2ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.0ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (3.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.6ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (1.0ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 142[0m [["rule_id", 142]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.3ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.6ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 143]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method_with_params --------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 144]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.6ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 146]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 147[0m [["rule_id", 147]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m 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]] [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.9ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 148[0m [["rule_id", 148]] [1m[35m (0.6ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.2ms)[0m [1mSELECT "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()))[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.7ms)[0m 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())) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.5ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (0.6ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 10:44:28.211870' WHERE "rooler_deliveries"."id" = 47 [1m[36mRooler::Delivery Load (0.7ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 47]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "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()))[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 154]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.2ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.6ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.8ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 156[0m [["rule_id", 156]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.3ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method_with_params --------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.3ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35m (0.3ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.7ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.7ms)[0m 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]] [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 162[0m [["rule_id", 162]] [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.0ms)[0m 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())) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "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()))[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.9ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 167]] [1m[35mRooler::Rule Load (0.9ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 10:51:40.467669' WHERE "rooler_deliveries"."id" = 52[0m [1m[35mRooler::Delivery Load (0.7ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 52]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m 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())) [1m[36mRooler::Rule Load (0.3ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.5ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 169]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (11.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.6ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.7ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 171[0m [["rule_id", 171]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.7ms)[0m 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]] [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.4ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method_with_params --------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.3ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 177[0m [["rule_id", 177]] [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.7ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.5ms)[0m 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]] [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 178[0m [["rule_id", 178]] [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "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()))[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.7ms)[0m 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())) [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.5ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.9ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (0.6ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 11:03:46.836303' WHERE "rooler_deliveries"."id" = 58 [1m[36mRooler::Delivery Load (0.8ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 58]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "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()))[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.5ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["id", 184]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (8.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.1ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.3ms)[0m INSERT 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.9ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.8ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 186[0m [["rule_id", 186]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method_with_params --------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.3ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35m (0.5ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.9ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.5ms)[0m ROLLBACK [1m[36m (0.3ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.2ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.9ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 192[0m [["rule_id", 192]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.5ms)[0m 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]] [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 193[0m [["rule_id", 193]] [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.1ms)[0m [1mSELECT "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()))[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.6ms)[0m 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())) [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (0.6ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 11:04:24.394783' WHERE "rooler_deliveries"."id" = 64 [1m[36mRooler::Delivery Load (1.2ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 64]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "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()))[0m [1m[35mRooler::Rule Load (0.3ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.3ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["id", 199]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (10.3ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.9ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.3ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.5ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.7ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 201[0m [["rule_id", 201]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.1ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method_with_params --------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" LIMIT 1 [1m[36m (0.1ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.8ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 207[0m [["rule_id", 207]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.5ms)[0m 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]] [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.6ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 208[0m [["rule_id", 208]] [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "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()))[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.6ms)[0m 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())) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.3ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (1.1ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 11:10:56.797320' WHERE "rooler_deliveries"."id" = 69 [1m[36mRooler::Delivery Load (1.2ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 69]] [1m[35m (0.4ms)[0m ROLLBACK [1m[36m (0.3ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "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()))[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["id", 214]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.1ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.2ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.4ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (1.2ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 216[0m [["rule_id", 216]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.3ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.3ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.3ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.9ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 220[0m [["rule_id", 220]] [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (1.0ms)[0m 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]] [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_unprocessed_objects_of_rules_class_using_klass_method_with_params ------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m 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())) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "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()))[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 227]] [1m[35mRooler::Rule Load (0.9ms)[0m 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 [1m[36mSQL (1.1ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 11:14:00.557213' WHERE "rooler_deliveries"."id" = 74[0m [1m[35mRooler::Delivery Load (1.2ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 74]] [1m[36m (0.5ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.7ms)[0m 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())) [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 229]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.0ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.9ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.6ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.8ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 231[0m [["rule_id", 231]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.3ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.6ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.7ms)[0m 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]] [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 235[0m [["rule_id", 235]] [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.7ms)[0m 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]] [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_unprocessed_objects_of_rules_class_using_klass_method_with_params ------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" LIMIT 1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."klass_name" = 'Rooler::Rule'[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.0ms)[0m 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())) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.3ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "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()))[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 243]] [1m[35mRooler::Rule Load (0.9ms)[0m 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 [1m[36mSQL (1.1ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 11:14:48.054343' WHERE "rooler_deliveries"."id" = 79[0m [1m[35mRooler::Delivery Load (1.3ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 79]] [1m[36m (0.5ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m 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())) [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.5ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 245]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (8.3ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.2ms)[0m INSERT 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.1ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.5ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.8ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 247[0m [["rule_id", 247]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.7ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.3ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 251[0m [["rule_id", 251]] [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.7ms)[0m 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]] [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_unprocessed_objects_of_rules_class_using_klass_method_with_params ------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" LIMIT 1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."klass_name" = 'Rooler::Rule'[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m 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())) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "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()))[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.5ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.9ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 259]] [1m[35mRooler::Rule Load (0.8ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 11:26:57.267193' WHERE "rooler_deliveries"."id" = 84[0m [1m[35mRooler::Delivery Load (0.7ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 84]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.6ms)[0m 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())) [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.5ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 261]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (25.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.9ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.7ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 266]] [1m[36mRooler::Rule Load (0.8ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 16:48:30.530306' WHERE "rooler_rules"."id" = 266 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 16:48:30.678742' WHERE "rooler_rules"."id" = 266[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true -------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_unprocessed_objects_of_rules_class_using_klass_method_with_params ------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" LIMIT 1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."klass_name" = 'Rooler::Rule'[0m [1m[35m (0.1ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.0ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.5ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (0.8ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 16:48:30.837128' WHERE "rooler_deliveries"."id" = 88 [1m[36mRooler::Delivery Load (0.8ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 88]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 274]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 16:48:30.864270' WHERE "rooler_rules"."id" = 274 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["id", 274]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.8ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.5ms)[0m INSERT 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.7ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1 [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (1.0ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 278]] [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 16:58:54.247229' WHERE "rooler_rules"."id" = 278 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 16:58:54.267223' WHERE "rooler_rules"."id" = 278[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" LIMIT 1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."klass_name" = 'Rooler::Rule' [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_or_arrays ------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 284]] [1m[35mRooler::Rule Load (0.9ms)[0m 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 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 16:58:54.404152' WHERE "rooler_deliveries"."id" = 92[0m [1m[35mRooler::Delivery Load (0.7ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 92]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT 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"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 286]] [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 16:58:54.428167' WHERE "rooler_rules"."id" = 286[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 286]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (8.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.0ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.4ms)[0m INSERT 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.7ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m 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 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (1.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 288]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m 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) [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- 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 [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------------------- 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 [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.0ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.8ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (0.9ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 17:17:50.079941' WHERE "rooler_deliveries"."id" = 95 [1m[36mRooler::Delivery Load (0.9ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 95]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.3ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 295]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m 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) [1m[35m (0.1ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.7ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.2ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (3.6ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.6ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.6ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.6ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 4]] [1m[36mFoo Load (0.6ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35mSQL (0.6ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 17:18:46.208980' WHERE "rooler_rules"."id" = 4 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_or_arrays ------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 6]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 17:18:46.264007' WHERE "rooler_rules"."id" = 6 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.5ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.2ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.3ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 12]] [1m[35mRooler::Rule Load (0.8ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 17:18:46.393294' WHERE "rooler_deliveries"."id" = 3[0m [1m[35mRooler::Delivery Load (0.7ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 3]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 14]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 17:18:46.411032' WHERE "rooler_rules"."id" = 14[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.8ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.0ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.7ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 18]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 17:21:59.479198' WHERE "rooler_rules"."id" = 18[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.8ms)[0m 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 [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 17:21:59.507870' WHERE "rooler_rules"."id" = 18 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_or_arrays ------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 20]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.8ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m INSERT 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 17:21:59.554355' WHERE "rooler_rules"."id" = 20 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.4ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.2ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.4ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.7ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.9ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 26]] [1m[35mRooler::Rule Load (0.9ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 17:21:59.707540' WHERE "rooler_deliveries"."id" = 7[0m [1m[35mRooler::Delivery Load (0.9ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 7]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 28]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 17:21:59.738814' WHERE "rooler_rules"."id" = 28 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mFoo Load (1.0ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1[0m [["id", 12]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.0ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.3ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.6ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.7ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (1.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 32]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 17:30:39.782031' WHERE "rooler_rules"."id" = 32[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 17:30:39.806484' WHERE "rooler_rules"."id" = 32 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_or_arrays ------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 34]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 17:30:39.846828' WHERE "rooler_rules"."id" = 34 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.5ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.1ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 40]] [1m[35mRooler::Rule Load (0.8ms)[0m 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 [1m[36mSQL (1.0ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 17:30:39.977735' WHERE "rooler_deliveries"."id" = 12[0m [1m[35mRooler::Delivery Load (1.3ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 12]] [1m[36m (0.5ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 42]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 17:30:40.005202' WHERE "rooler_rules"."id" = 42 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mFoo Load (0.8ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1[0m [["id", 19]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.5ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.2ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.2ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (3.0ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.6ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 46]] [1m[35mFoo Load (0.7ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.7ms)[0m 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 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 17:31:47.839270' WHERE "rooler_rules"."id" = 46[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36m (0.5ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 17:31:47.861509' WHERE "rooler_rules"."id" = 46 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_or_arrays ------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 48]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 17:31:47.901508' WHERE "rooler_rules"."id" = 48 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.1ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 54]] [1m[35mRooler::Rule Load (0.8ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 17:31:48.036259' WHERE "rooler_deliveries"."id" = 17[0m [1m[35mRooler::Delivery Load (0.7ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 17]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 56]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 17:31:48.061408' WHERE "rooler_rules"."id" = 56 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.5ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mFoo Load (0.7ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1[0m [["id", 26]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.1ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.3ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.6ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (1.1ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 60]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 17:32:09.943796' WHERE "rooler_rules"."id" = 60[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36m (0.5ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 17:32:09.965625' WHERE "rooler_rules"."id" = 60 [1m[36m (0.7ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.3ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 17:32:09 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 17:32:09 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_or_arrays ------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 62]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 17:32:10.009960' WHERE "rooler_rules"."id" = 62 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.8ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 62]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.4ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.8ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (0.5ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 17:32:10.141461' WHERE "rooler_deliveries"."id" = 22 [1m[36mRooler::Delivery Load (0.7ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 22]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 17:32:10 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 17:32:10 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 70]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 17:32:10.166973' WHERE "rooler_rules"."id" = 70[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.7ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 33]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (8.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.8ms)[0m INSERT 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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (3.3ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.7ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (1.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 74]] [1m[35mFoo Load (0.7ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:03:52.097337' WHERE "rooler_rules"."id" = 74[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36m (0.5ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:03:52.118015' WHERE "rooler_rules"."id" = 74 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 76]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:03:52.161965' WHERE "rooler_rules"."id" = 76 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 76]] [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 76]] [1m[35mRooler::Rule Load (0.8ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 76]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.8ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (1.6ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (1.0ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:03:52.298307' WHERE "rooler_deliveries"."id" = 27 [1m[36mRooler::Delivery Load (1.0ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 27]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 84]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:03:52.324237' WHERE "rooler_rules"."id" = 84[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.7ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 40]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.5ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 88]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:04:33.449767' WHERE "rooler_rules"."id" = 88[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:04:33.470800' WHERE "rooler_rules"."id" = 88 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 90]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:04:33.511810' WHERE "rooler_rules"."id" = 90 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.9ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 90]] [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 90]] [1m[35mRooler::Rule Load (0.7ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 90]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.5ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.5ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (0.9ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:04:33.669139' WHERE "rooler_deliveries"."id" = 32 [1m[36mRooler::Delivery Load (1.2ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 32]] [1m[35m (0.5ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 98]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:04:33.697275' WHERE "rooler_rules"."id" = 98[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.8ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 47]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.0ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.0ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (2.4ms)[0m 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]] [1m[36m (0.5ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (1.0ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 102]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:05:22.774863' WHERE "rooler_rules"."id" = 102[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36m (0.5ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:05:22.796764' WHERE "rooler_rules"."id" = 102 [1m[36m (0.6ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.3ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 104]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:05:22.839972' WHERE "rooler_rules"."id" = 104 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.7ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 104]] [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 104]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 104]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.3ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (1.6ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (1.1ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:05:22.979115' WHERE "rooler_deliveries"."id" = 37 [1m[36mRooler::Delivery Load (0.7ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 37]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 112]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:05:23.006208' WHERE "rooler_rules"."id" = 112[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.7ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 54]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (11.4ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.6ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (1.1ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 116]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:05:44.288314' WHERE "rooler_rules"."id" = 116[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36m (0.5ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:05:44.309465' WHERE "rooler_rules"."id" = 116 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 118]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:05:44.353528' WHERE "rooler_rules"."id" = 118 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.7ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 118]] [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 118]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 118]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.2ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.5ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.9ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (0.7ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:05:44.503579' WHERE "rooler_deliveries"."id" = 42 [1m[36mRooler::Delivery Load (0.7ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 42]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 126]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:05:44.532434' WHERE "rooler_rules"."id" = 126[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.5ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.8ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 61]] [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[36m (0.3ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.8ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.4ms)[0m INSERT 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.9ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.7ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (1.1ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 130]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:06:20.392123' WHERE "rooler_rules"."id" = 130[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:06:20.415415' WHERE "rooler_rules"."id" = 130 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.5ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.8ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 132]] [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 132]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:06:20.460924' WHERE "rooler_rules"."id" = 132[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 132]] [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 132]] [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 132]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.5ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.3ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 138]] [1m[35mRooler::Rule Load (0.9ms)[0m 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 [1m[36mSQL (1.0ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:06:20.597337' WHERE "rooler_deliveries"."id" = 47[0m [1m[35mRooler::Delivery Load (0.7ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 47]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 140]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:06:20.624471' WHERE "rooler_rules"."id" = 140 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mFoo Load (0.8ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1[0m [["id", 68]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.5ms)[0m INSERT 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.5ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 144]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:06:34.642257' WHERE "rooler_rules"."id" = 144[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:06:34.663594' WHERE "rooler_rules"."id" = 144 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.7ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 146]] [1m[36m (0.6ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 146]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:06:34.708785' WHERE "rooler_rules"."id" = 146 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 146]] [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 146]] [1m[35mRooler::Rule Load (0.7ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 146]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.2ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (0.5ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:06:34.849888' WHERE "rooler_deliveries"."id" = 52 [1m[36mRooler::Delivery Load (0.7ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 52]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 154]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:06:34.876307' WHERE "rooler_rules"."id" = 154[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.7ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 75]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (9.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.2ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.6ms)[0m INSERT 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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (3.4ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.7ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 158]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:07:13.720583' WHERE "rooler_rules"."id" = 158[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:07:13.751538' WHERE "rooler_rules"."id" = 158 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.7ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 160]] [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 160]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:07:13.796857' WHERE "rooler_rules"."id" = 160 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 160]] [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 160]] [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 160]] [1m[36mFoo Load (0.6ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.9ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.8ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (1.1ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:07:13.940687' WHERE "rooler_deliveries"."id" = 57 [1m[36mRooler::Delivery Load (1.3ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 57]] [1m[35m (0.5ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 168]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:07:13.969388' WHERE "rooler_rules"."id" = 168[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.7ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 82]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.0ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.6ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.9ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 172]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:07:33.583541' WHERE "rooler_rules"."id" = 172[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36m (0.5ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:07:33.605341' WHERE "rooler_rules"."id" = 172 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.3ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.1ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.7ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 174]] [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 174]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:07:33.650072' WHERE "rooler_rules"."id" = 174 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 174]] [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 174]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 174]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.0ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.9ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (1.0ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:07:33.780534' WHERE "rooler_deliveries"."id" = 62 [1m[36mRooler::Delivery Load (0.9ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 62]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 182]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:07:33.806398' WHERE "rooler_rules"."id" = 182[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.7ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 89]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (8.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.1ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.3ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.7ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 186]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:07:52.489273' WHERE "rooler_rules"."id" = 186[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36m (0.5ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:07:52.511811' WHERE "rooler_rules"."id" = 186 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.7ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 188]] [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 188]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:07:52.557107' WHERE "rooler_rules"."id" = 188 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 188]] [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 188]] [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 188]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.4ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (0.5ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:07:52.695670' WHERE "rooler_deliveries"."id" = 67 [1m[36mRooler::Delivery Load (0.7ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 67]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 196]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:07:52.721443' WHERE "rooler_rules"."id" = 196[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.6ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.8ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 96]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.5ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.8ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.6ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.8ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.4ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 200]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:09:41.177711' WHERE "rooler_rules"."id" = 200[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:09:41.200729' WHERE "rooler_rules"."id" = 200 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.7ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 202]] [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 202]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:09:41.245694' WHERE "rooler_rules"."id" = 202 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 202]] [1m[36mFoo Load (0.7ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (0.7ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:09:41.381794' WHERE "rooler_deliveries"."id" = 72 [1m[36mRooler::Delivery Load (1.1ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 72]] [1m[35m (0.4ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 210]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:09:41.410259' WHERE "rooler_rules"."id" = 210[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.7ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 103]] [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.0ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.6ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 214]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:10:49.465277' WHERE "rooler_rules"."id" = 214[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 214]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (105))[0m [1m[35mSQL (0.3ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:10:49.470342' WHERE "rooler_rules"."id" = 214 [1m[36m (0.2ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.7ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 216]] [1m[36m (0.6ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 216]] [1m[35mFoo Load (0.8ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 216]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:10:49.519677' WHERE "rooler_rules"."id" = 216[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 216]] [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 216]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (108))[0m [1m[35mFoo Load (0.2ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.3ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 222]] [1m[35mRooler::Rule Load (0.8ms)[0m 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 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:10:49.661814' WHERE "rooler_deliveries"."id" = 77[0m [1m[35mRooler::Delivery Load (0.6ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 77]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 224]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:10:49.690154' WHERE "rooler_rules"."id" = 224 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mFoo Load (0.7ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1[0m [["id", 110]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.2ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.7ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (1.0ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 228]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:11:48.295782' WHERE "rooler_rules"."id" = 228[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 228]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (112))[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:11:48.302708' WHERE "rooler_rules"."id" = 228 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.7ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 230]] [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 230]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 230]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:11:48.347139' WHERE "rooler_rules"."id" = 230[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 230]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (115)) [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 231]] [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 231]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.4ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.8ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (0.5ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:11:48.486641' WHERE "rooler_deliveries"."id" = 82 [1m[36mRooler::Delivery Load (0.7ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 82]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 238]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:11:48.514351' WHERE "rooler_rules"."id" = 238[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.7ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 117]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.3ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.7ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.4ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.6ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.8ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 242]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:12:14.847345' WHERE "rooler_rules"."id" = 242[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 242]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (119))[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:12:14.853379' WHERE "rooler_rules"."id" = 242 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.7ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 244]] [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 244]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 244]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:12:14.900579' WHERE "rooler_rules"."id" = 244[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 244]] [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 244]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (122))[0m [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 245]] [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 245]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.1ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.8ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.7ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 250]] [1m[35mRooler::Rule Load (0.9ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:12:15.049287' WHERE "rooler_deliveries"."id" = 87[0m [1m[35mRooler::Delivery Load (1.1ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 87]] [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 252]] [1m[36mFoo Load (0.6ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:12:15.081287' WHERE "rooler_rules"."id" = 252 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.6ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mFoo Load (0.7ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1[0m [["id", 124]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.2ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.2ms)[0m INSERT 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.5ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 256]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:14:38.726654' WHERE "rooler_rules"."id" = 256[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 256]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (126))[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:14:38.731815' WHERE "rooler_rules"."id" = 256 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.8ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 258]] [1m[36m (0.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 258]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 258]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:14:38.778208' WHERE "rooler_rules"."id" = 258[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (0.5ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:14:38.873574' WHERE "rooler_deliveries"."id" = 92 [1m[36mRooler::Delivery Load (0.7ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 92]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 265]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:14:38.899665' WHERE "rooler_rules"."id" = 265[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.7ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 130]] [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.0ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.2ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 269]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:15:05.786066' WHERE "rooler_rules"."id" = 269[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 269]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (132))[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:15:05.792160' WHERE "rooler_rules"."id" = 269 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.7ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 271]] [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 271]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 271]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:15:05.836919' WHERE "rooler_rules"."id" = 271[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 271]] [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 271]] [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 271]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 271]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 271]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (135)) [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 272]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 272]] [1m[35m (0.4ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.2ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (1.1ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:15:05.975876' WHERE "rooler_deliveries"."id" = 97 [1m[36mRooler::Delivery Load (0.8ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 97]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 279]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:15:06.002658' WHERE "rooler_rules"."id" = 279[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.7ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 137]] [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (8.5ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.1ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.5ms)[0m INSERT 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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.9ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.6ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (1.0ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 283]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:15:47.361825' WHERE "rooler_rules"."id" = 283[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 283]] [1m[36mFoo Load (0.7ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (139))[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:15:47.369009' WHERE "rooler_rules"."id" = 283 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.7ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 285]] [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 285]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 285]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:15:47.413825' WHERE "rooler_rules"."id" = 285[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 285]] [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 285]] [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 285]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 285]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 285]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (142)) [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.2ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (0.8ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:15:47.553112' WHERE "rooler_deliveries"."id" = 102 [1m[36mRooler::Delivery Load (1.2ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 102]] [1m[35m (0.4ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 293]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:15:47.580628' WHERE "rooler_rules"."id" = 293[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.7ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 144]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[36m (0.3ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (2.0ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.9ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.2ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.9ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.5ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 297]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:17:11.191419' WHERE "rooler_rules"."id" = 297[0m [1m[35m (0.6ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 297]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (146))[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:17:11.197443' WHERE "rooler_rules"."id" = 297 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.7ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 299]] [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 299]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 299]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:17:11.242005' WHERE "rooler_rules"."id" = 299[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 299]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 299]] [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 299]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 299]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 299]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (149)) [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 300]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 300]] [1m[35m (0.4ms)[0m ROLLBACK [1m[36m (0.3ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.0ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (1.1ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:17:11.384660' WHERE "rooler_deliveries"."id" = 107 [1m[36mRooler::Delivery Load (1.2ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 107]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 307]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:17:11.414655' WHERE "rooler_rules"."id" = 307[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.7ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 151]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.6ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.3ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.3ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.5ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.6ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (1.1ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 311]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:19:34.831048' WHERE "rooler_rules"."id" = 311[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 311]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (153))[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:19:34.836200' WHERE "rooler_rules"."id" = 311 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.7ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 313]] [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 313]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 313]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:19:34.889958' WHERE "rooler_rules"."id" = 313[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 314]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:19:34.898849' WHERE "rooler_rules"."id" = 314 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 313]] [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 313]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 313]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 313]] [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 313]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (156))[0m [1m[35m (0.2ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 314]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.1ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 319]] [1m[35mRooler::Rule Load (0.9ms)[0m 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 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:19:35.026864' WHERE "rooler_deliveries"."id" = 113[0m [1m[35mRooler::Delivery Load (0.7ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 113]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 321]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:19:35.053065' WHERE "rooler_rules"."id" = 321 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.5ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mFoo Load (0.7ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1[0m [["id", 158]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.4ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.0ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.9ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.6ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (1.0ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 325]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:20:05.855561' WHERE "rooler_rules"."id" = 325[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 325]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (160))[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:20:05.861541' WHERE "rooler_rules"."id" = 325 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.1ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 327]] [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 327]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 327]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:20:05.913670' WHERE "rooler_rules"."id" = 327[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 328]] [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:20:05.922152' WHERE "rooler_rules"."id" = 328 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 327]] [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 327]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 327]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 327]] [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 327]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (163))[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 328]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 328]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.5ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (0.9ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:20:06.053514' WHERE "rooler_deliveries"."id" = 119 [1m[36mRooler::Delivery Load (0.7ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 119]] [1m[35m (0.4ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:20:06 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:20:06 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 335]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:20:06.080172' WHERE "rooler_rules"."id" = 335[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.8ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 165]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.0ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.6ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (1.0ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 339]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:20:37.535526' WHERE "rooler_rules"."id" = 339[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 339]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (167))[0m [1m[35mSQL (0.3ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:20:37.540336' WHERE "rooler_rules"."id" = 339 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 341]] [1m[36m (0.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 341]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 341]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:20:37.594537' WHERE "rooler_rules"."id" = 341[0m [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 342]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:20:37.603086' WHERE "rooler_rules"."id" = 342 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 342]] [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 342]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 342]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (1.0ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:20:37.697909' WHERE "rooler_deliveries"."id" = 125 [1m[36mRooler::Delivery Load (1.2ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 125]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 349]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:20:37.728862' WHERE "rooler_rules"."id" = 349[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.5ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.8ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 171]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.9ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.7ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 353]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:20:57.599368' WHERE "rooler_rules"."id" = 353[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 353]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (173))[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:20:57.606057' WHERE "rooler_rules"."id" = 353 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.7ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 355]] [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 355]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 355]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:20:57.660801' WHERE "rooler_rules"."id" = 355[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 356]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.5ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:20:57.669006' WHERE "rooler_rules"."id" = 356 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 356]] [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 356]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 356]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 355]] [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 355]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (176))[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 356]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 356]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (1.6ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (1.1ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:20:57.802259' WHERE "rooler_deliveries"."id" = 131 [1m[36mRooler::Delivery Load (1.0ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 131]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 363]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:20:57.829522' WHERE "rooler_rules"."id" = 363[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.5ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.8ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 178]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (9.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.9ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.7ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.5ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 367]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:22:35.647216' WHERE "rooler_rules"."id" = 367[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 367]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (180))[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:22:35.651964' WHERE "rooler_rules"."id" = 367 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.9ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 369]] [1m[36m (0.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 369]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 369]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:22:35.705669' WHERE "rooler_rules"."id" = 369[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 370]] [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m INSERT 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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:22:35.714867' WHERE "rooler_rules"."id" = 370 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 370]] [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 370]] [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 370]] [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 369]] [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 369]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (183))[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 370]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 370]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.8ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (0.5ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:22:35.845629' WHERE "rooler_deliveries"."id" = 137 [1m[36mRooler::Delivery Load (0.7ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 137]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 377]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:22:35.871613' WHERE "rooler_rules"."id" = 377[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.7ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 185]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.4ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.7ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (1.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 381]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:23:11.766416' WHERE "rooler_rules"."id" = 381[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 381]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (187))[0m [1m[35mSQL (0.3ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:23:11.771342' WHERE "rooler_rules"."id" = 381 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.7ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 383]] [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 383]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.6ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 383]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:23:11.828113' WHERE "rooler_rules"."id" = 383[0m [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 384]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:23:11.836268' WHERE "rooler_rules"."id" = 384 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 384]] [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 384]] [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 384]] [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 383]] [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 383]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (190))[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 384]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 384]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (0.5ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:23:11.971119' WHERE "rooler_deliveries"."id" = 143 [1m[36mRooler::Delivery Load (0.7ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 143]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 391]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:23:11.998691' WHERE "rooler_rules"."id" = 391[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.5ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.7ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 192]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (12.2ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m INSERT 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.7ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.9ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 395]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:23:39.295216' WHERE "rooler_rules"."id" = 395[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 395]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (194))[0m [1m[35mSQL (0.6ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:23:39.301119' WHERE "rooler_rules"."id" = 395 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.8ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 397]] [1m[36m (0.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 397]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 397]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:23:39.352341' WHERE "rooler_rules"."id" = 397[0m [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:23:39.359882' WHERE "rooler_rules"."id" = 398[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 398]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 398]] [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 397]] [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 397]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (197))[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 398]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.1ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 403]] [1m[35mRooler::Rule Load (0.9ms)[0m 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 [1m[36mSQL (1.0ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:23:39.484926' WHERE "rooler_deliveries"."id" = 149[0m [1m[35mRooler::Delivery Load (1.0ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 149]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 405]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:23:39.513065' WHERE "rooler_rules"."id" = 405 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mFoo Load (0.8ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1[0m [["id", 199]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.5ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.9ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.4ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.8ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.6ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (2.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (1.6ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (3.2ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.8ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m 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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.4ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (1.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 409]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:26:34.920287' WHERE "rooler_rules"."id" = 409[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 409]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (201))[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:26:34.925601' WHERE "rooler_rules"."id" = 409 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:26:34 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:26:34 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.9ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 411]] [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 411]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 411]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:26:34.987165' WHERE "rooler_rules"."id" = 411[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:26:34.997346' WHERE "rooler_rules"."id" = 412[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 412]] [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 412]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 411]] [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 411]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (204)) [1m[36mRooler::Rule Load (1.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 412]] [1m[35mFoo Load (0.8ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.6ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.2ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.5ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (1.0ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 417]] [1m[35mRooler::Rule Load (0.9ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:26:35.155394' WHERE "rooler_deliveries"."id" = 155[0m [1m[35mRooler::Delivery Load (1.1ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 155]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 419]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:26:35.184713' WHERE "rooler_rules"."id" = 419 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mFoo Load (0.8ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1[0m [["id", 206]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (8.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.7ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.7ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (1.0ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 423]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:30:24.732274' WHERE "rooler_rules"."id" = 423[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 423]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (208))[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:30:24.737829' WHERE "rooler_rules"."id" = 423 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.8ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 425]] [1m[36m (0.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 425]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 425]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:30:24.792165' WHERE "rooler_rules"."id" = 425[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 426]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.5ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:30:24.800476' WHERE "rooler_rules"."id" = 426 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 426]] [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 425]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.1ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.5ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 431]] [1m[35mRooler::Rule Load (0.9ms)[0m 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 [1m[36mSQL (1.2ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:30:24.926228' WHERE "rooler_deliveries"."id" = 161[0m [1m[35mRooler::Delivery Load (1.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 161]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 433]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:30:24.954561' WHERE "rooler_rules"."id" = 433 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mFoo Load (0.7ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1[0m [["id", 213]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (8.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.7ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (2.0ms)[0m 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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.6ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 437]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:30:47.250165' WHERE "rooler_rules"."id" = 437[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 437]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (215))[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:30:47.255486' WHERE "rooler_rules"."id" = 437 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.9ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 439]] [1m[36m (0.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 439]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 439]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.7ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:30:47.309873' WHERE "rooler_rules"."id" = 439[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 440]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:30:47.318842' WHERE "rooler_rules"."id" = 440 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 440]] [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 439]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.1ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.9ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 445]] [1m[35mRooler::Rule Load (0.8ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:30:47.448347' WHERE "rooler_deliveries"."id" = 167[0m [1m[35mRooler::Delivery Load (1.2ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 167]] [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 447]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:30:47.478006' WHERE "rooler_rules"."id" = 447 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.5ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mFoo Load (0.7ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1[0m [["id", 220]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.7ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.5ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.5ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.4ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 451]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:32:52.148939' WHERE "rooler_rules"."id" = 451[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.7ms)[0m 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 [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:32:52.172216' WHERE "rooler_rules"."id" = 451 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.9ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 453]] [1m[36m (0.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 453]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:32:52.228497' WHERE "rooler_rules"."id" = 453 [1m[36mFoo Load (0.6ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 454]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:32:52.239619' WHERE "rooler_rules"."id" = 454[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 454]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 454]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 453]] [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 453]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (225)) [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 454]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 454]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.0ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.8ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (0.5ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:32:52.354451' WHERE "rooler_deliveries"."id" = 173 [1m[36mRooler::Delivery Load (0.8ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 173]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 461]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:32:52.379623' WHERE "rooler_rules"."id" = 461[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.8ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 227]] [1m[36m (0.7ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.2ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.5ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.6ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 465]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:46:53 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:46:53 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:46:53 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:46:53 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 468]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (1.0ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 468]] [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 467]] [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 467]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.1ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 473]] [1m[35mRooler::Rule Load (0.9ms)[0m 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 [1m[36mSQL (1.2ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:46:54.110340' WHERE "rooler_deliveries"."id" = 176[0m [1m[35mRooler::Delivery Load (1.0ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 176]] [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 475]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.5ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.0ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.5ms)[0m INSERT 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.7ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 479]] [1m[35m (0.7ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 479]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.8ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:48:23.064852' WHERE "rooler_rules"."id" = 479 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 479]] [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 479]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (236))[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:48:23.072542' WHERE "rooler_rules"."id" = 479 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 482]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 482]] [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 481]] [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 481]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.6ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.1ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 487]] [1m[35mRooler::Rule Load (0.9ms)[0m 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 [1m[36mSQL (1.0ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:48:23.237910' WHERE "rooler_deliveries"."id" = 179[0m [1m[35mRooler::Delivery Load (0.7ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 179]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 489]] [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 489]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:48:23.266744' WHERE "rooler_rules"."id" = 489[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.7ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 241]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (9.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.1ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.0ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.5ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 493]] [1m[35m (1.1ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 493]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:49:16.766066' WHERE "rooler_rules"."id" = 493 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 493]] [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 493]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (243))[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:49:16.772887' WHERE "rooler_rules"."id" = 493 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 496]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 496]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 495]] [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 495]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.5ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.1ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.5ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 501]] [1m[35mRooler::Rule Load (0.9ms)[0m 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 [1m[36mSQL (1.0ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:49:16.935887' WHERE "rooler_deliveries"."id" = 183[0m [1m[35mRooler::Delivery Load (1.0ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 183]] [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 503]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 503]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:49:16.963743' WHERE "rooler_rules"."id" = 503[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.7ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 248]] [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[36m (0.4ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (22.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.6ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.0ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.5ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 507]] [1m[35m (1.2ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 507]] [1m[36mFoo Load (0.6ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 09:12:15.843252' WHERE "rooler_rules"."id" = 507 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 507]] [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 507]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (250))[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 09:12:15.850141' WHERE "rooler_rules"."id" = 507 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (1.3ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 510]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 510]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 509]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 509]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.5ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.1ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.5ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 515]] [1m[35mRooler::Rule Load (0.8ms)[0m 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 [1m[36mSQL (0.9ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 09:12:16.074730' WHERE "rooler_deliveries"."id" = 187[0m [1m[35mRooler::Delivery Load (1.0ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 187]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.5ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 517]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 517]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 09:12:16.104731' WHERE "rooler_rules"."id" = 517[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.5ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.8ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 255]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (16.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.7ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.3ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.1ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 521]] [1m[35m (1.1ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 521]] [1m[36mFoo Load (0.6ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 10:13:32.444154' WHERE "rooler_rules"."id" = 521 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 521]] [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 521]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (257))[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 10:13:32.451096' WHERE "rooler_rules"."id" = 521 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 524]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 524]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 523]] [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 523]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.6ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.3ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.4ms)[0m ROLLBACK [1m[36m (0.3ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.8ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (1.0ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 529]] [1m[35mRooler::Rule Load (1.0ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 10:13:32.664323' WHERE "rooler_deliveries"."id" = 191[0m [1m[35mRooler::Delivery Load (0.8ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 191]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 531]] [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 531]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 10:13:32.695935' WHERE "rooler_rules"."id" = 531[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.5ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.8ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 262]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.4ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.5ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.5ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.9ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.9ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.7ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 535]] [1m[35m (1.0ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 535]] [1m[36mFoo Load (0.6ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 10:15:40.945859' WHERE "rooler_rules"."id" = 535 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 535]] [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 535]] [1m[36mFoo Load (0.6ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (264))[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 10:15:40.954946' WHERE "rooler_rules"."id" = 535 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 10:15:40 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 10:15:40 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 10:15:40 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 10:15:40 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 538]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 538]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 537]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 537]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.5ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.1ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 543]] [1m[35mRooler::Rule Load (0.9ms)[0m 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 [1m[36mSQL (1.1ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 10:15:41.120794' WHERE "rooler_deliveries"."id" = 195[0m [1m[35mRooler::Delivery Load (1.3ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 195]] [1m[36m (0.5ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 545]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 545]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 10:15:41.150309' WHERE "rooler_rules"."id" = 545[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.7ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 269]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[36m (260.7ms)[0m [1mDROP DATABASE IF EXISTS "dummy_test"[0m [1m[35m (1238.4ms)[0m CREATE DATABASE "dummy_test" ENCODING = 'utf8' [1m[36mSQL (2.1ms)[0m [1mCREATE EXTENSION IF NOT EXISTS "plpgsql"[0m [1m[35m (7.3ms)[0m CREATE TABLE "foos" ("id" serial primary key, "created_at" timestamp, "updated_at" timestamp) [1m[36m (4.6ms)[0m [1mCREATE 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) [0m [1m[35m (5.8ms)[0m 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)) [1m[36m (5.8ms)[0m [1mCREATE 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) [0m [1m[35m (1.6ms)[0m CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL) [1m[36m (1.9ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m [1m[35m (0.4ms)[0m SELECT version FROM "schema_migrations" [1m[36m (0.7ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20140317170346')[0m [1m[35m (1.3ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20140226113304') [1m[36m (0.5ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20140226113305')[0m [1m[35m (0.5ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20140226120455') [1m[36m (0.5ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20140313103833')[0m [1m[35mActiveRecord::SchemaMigration Load (0.4ms)[0m SELECT "schema_migrations".* FROM "schema_migrations" [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (9.3ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (3.5ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (3.4ms)[0m [1mROLLBACK[0m [1m[35m (0.5ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (2.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.2ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 4]] [1m[35m (0.6ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 4]] [1m[36mFoo Load (0.6ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 10:39:17.032956' WHERE "rooler_rules"."id" = 4 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 4]] [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 4]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (2))[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 10:39:17.041185' WHERE "rooler_rules"."id" = 4 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.1ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 7]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 7]] [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 6]] [1m[36m (1.0ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 6]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.6ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.5ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 12]] [1m[35mRooler::Rule Load (0.8ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 10:39:17.255323' WHERE "rooler_deliveries"."id" = 3[0m [1m[35mRooler::Delivery Load (0.9ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 3]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 14]] [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 14]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 10:39:17.292972' WHERE "rooler_rules"."id" = 14[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.6ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.8ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 7]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.2ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (3.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.7ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.8ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 18]] [1m[35mFoo Load (0.7ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 10:47:30.457609' WHERE "rooler_rules"."id" = 18[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.7ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 18]] [1m[36mFoo Load (0.8ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (9))[0m [1m[35mSQL (0.9ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 10:47:30.463612' WHERE "rooler_rules"."id" = 18 [1m[36m (0.7ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.1ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 21]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 21]] [1m[35m (0.6ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 21]] [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 20]] [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 20]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.5ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.6ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.8ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (0.7ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 10:47:30.633547' WHERE "rooler_deliveries"."id" = 7 [1m[36mRooler::Delivery Load (1.3ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 7]] [1m[35m (0.4ms)[0m ROLLBACK [1m[36m (0.3ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 28]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 10:47:30.664472' WHERE "rooler_rules"."id" = 28[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.7ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 14]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[36m (0.3ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (61.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.6ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (3.3ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.6ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 32]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:08:20.431173' WHERE "rooler_rules"."id" = 32[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 32]] [1m[36mFoo Load (0.6ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (16))[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:08:20.437913' WHERE "rooler_rules"."id" = 32 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.2ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 34]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:08:20.498592' WHERE "rooler_rules"."id" = 34 [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.6ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 35]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:08:20.511312' WHERE "rooler_rules"."id" = 35[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.8ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 34]] [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 34]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (19))[0m [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 35]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 35]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 35]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.3ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.5ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (1.1ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (0.6ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 11:08:20.646340' WHERE "rooler_deliveries"."id" = 13 [1m[36mRooler::Delivery Load (0.9ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 13]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 42]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:08:20.678036' WHERE "rooler_rules"."id" = 42[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.5ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.8ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 21]] [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.5ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.3ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.4ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.5ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 46]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:12:00.976496' WHERE "rooler_rules"."id" = 46[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 46]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (23))[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:12:00.982262' WHERE "rooler_rules"."id" = 46 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 11:12:00 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:12:00 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 48]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:12:01.032004' WHERE "rooler_rules"."id" = 48 [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 49]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:12:01.040081' WHERE "rooler_rules"."id" = 49[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 11:12:01 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:12:01 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 48]] [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 48]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (26))[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 49]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 49]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 49]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (1.1ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 11:12:01.150051' WHERE "rooler_deliveries"."id" = 19 [1m[36mRooler::Delivery Load (1.3ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 19]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 11:12:01 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:12:01 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 56]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:12:01.180304' WHERE "rooler_rules"."id" = 56[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.7ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 28]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (3.4ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.5ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 60]] [1m[35m (0.7ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 60]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:12:37.996681' WHERE "rooler_rules"."id" = 60 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 60]] [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 60]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (30))[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:12:38.004037' WHERE "rooler_rules"."id" = 60 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 11:12:38 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:12:38 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 62]] [1m[36m (0.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 62]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:12:38.053039' WHERE "rooler_rules"."id" = 62[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 63]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 63]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:12:38.062351' WHERE "rooler_rules"."id" = 63[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 11:12:38 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:12:38 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 62]] [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 62]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (33))[0m [1m[35mRooler::Rule Load (0.7ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 63]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 63]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 68]] [1m[35mRooler::Rule Load (0.9ms)[0m 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 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 11:12:38.165586' WHERE "rooler_deliveries"."id" = 25[0m [1m[35mRooler::Delivery Load (0.7ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 25]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 70]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 70]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:12:38.193289' WHERE "rooler_rules"."id" = 70[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.7ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 35]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.1ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.7ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (1.1ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 74]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:13:27.000462' WHERE "rooler_rules"."id" = 74[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:13:27.020440' WHERE "rooler_rules"."id" = 74[0m [1m[35m (0.7ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 11:13:27 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:13:27 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" LIMIT 1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 11:13:27 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:13:27 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 76]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:13:27.072185' WHERE "rooler_rules"."id" = 76[0m [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 77]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:13:27.080652' WHERE "rooler_rules"."id" = 77 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 76]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.1ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 82]] [1m[35mRooler::Rule Load (0.9ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 11:13:27.203526' WHERE "rooler_deliveries"."id" = 31[0m [1m[35mRooler::Delivery Load (0.8ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 31]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 84]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:13:27.230393' WHERE "rooler_rules"."id" = 84 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mFoo Load (0.7ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1[0m [["id", 42]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.2ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.3ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (3.5ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.7ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (1.1ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 88]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:20:22.706652' WHERE "rooler_rules"."id" = 88[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 88]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (44))[0m [1m[35mSQL (0.3ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:20:22.712021' WHERE "rooler_rules"."id" = 88 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 90]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:20:22.757570' WHERE "rooler_rules"."id" = 90 [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 91]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:20:22.766309' WHERE "rooler_rules"."id" = 91[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 90]] [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 90]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (47))[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 91]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 91]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 91]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (1.0ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 11:20:22.869798' WHERE "rooler_deliveries"."id" = 37 [1m[36mRooler::Delivery Load (0.7ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 37]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 98]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:20:22.897110' WHERE "rooler_rules"."id" = 98[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.7ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 49]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.3ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.4ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.3ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.8ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 102]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:25:36.074375' WHERE "rooler_rules"."id" = 102[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 102]] [1m[36mFoo Load (0.6ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (51))[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:25:36.079826' WHERE "rooler_rules"."id" = 102 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 104]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:25:36.128755' WHERE "rooler_rules"."id" = 104 [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 105]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:25:36.138036' WHERE "rooler_rules"."id" = 105[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 104]] [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 104]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (54))[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 105]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 105]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 105]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.2ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.9ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.8ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (1.1ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 11:25:36.243396' WHERE "rooler_deliveries"."id" = 43 [1m[36mRooler::Delivery Load (1.0ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 43]] [1m[35m (0.4ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 112]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:25:36.270984' WHERE "rooler_rules"."id" = 112[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.6ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.7ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 56]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (8.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.2ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.5ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 4]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:44:05.178866' WHERE "rooler_rules"."id" = 4[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 4]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (2))[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:44:05.184542' WHERE "rooler_rules"."id" = 4 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 6]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:44:05.233808' WHERE "rooler_rules"."id" = 6 [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 7]] [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:44:05.243187' WHERE "rooler_rules"."id" = 7[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 6]] [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 6]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (5))[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 7]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 7]] [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 7]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 8]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:44:05.281903' WHERE "rooler_rules"."id" = 8[0m [1m[35m (0.2ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 8]] [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (7))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 8]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (7)) [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:44:05.288130' WHERE "rooler_rules"."id" = 8[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.3ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 13]] [1m[35mRooler::Rule Load (0.8ms)[0m 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 [1m[36mSQL (1.0ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 11:44:05.391255' WHERE "rooler_deliveries"."id" = 6[0m [1m[35mRooler::Delivery Load (1.0ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 6]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 15]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:44:05.419605' WHERE "rooler_rules"."id" = 15 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mFoo Load (0.7ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1[0m [["id", 8]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (8.2ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.7ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.7ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (1.0ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 19]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:44:45.572164' WHERE "rooler_rules"."id" = 19[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 19]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (10))[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:44:45.577518' WHERE "rooler_rules"."id" = 19 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 21]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:44:45.628009' WHERE "rooler_rules"."id" = 21 [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 22]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:44:45.638056' WHERE "rooler_rules"."id" = 22[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 21]] [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 21]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (13))[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 22]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 22]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 22]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 23]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:44:45.672262' WHERE "rooler_rules"."id" = 23[0m [1m[35m (0.2ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 23]] [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (15))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 23]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (15)) [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:44:45.678126' WHERE "rooler_rules"."id" = 23[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.1ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 28]] [1m[35mRooler::Rule Load (0.8ms)[0m 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 [1m[36mSQL (1.0ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 11:44:45.779749' WHERE "rooler_deliveries"."id" = 13[0m [1m[35mRooler::Delivery Load (1.3ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 13]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 30]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:44:45.808191' WHERE "rooler_rules"."id" = 30 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.5ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mFoo Load (0.7ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1[0m [["id", 16]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.4ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.1ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.9ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.5ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.4ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.8ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.9ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 34]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.7ms)[0m 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 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:50:25.865109' WHERE "rooler_rules"."id" = 34[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 34]] [1m[36mFoo Load (0.6ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (18))[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:50:25.872930' WHERE "rooler_rules"."id" = 34 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.2ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (1.5ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 36]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:50:25.934472' WHERE "rooler_rules"."id" = 36 [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 37]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:50:25.942473' WHERE "rooler_rules"."id" = 37[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 36]] [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 36]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (21))[0m [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 37]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 37]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 37]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 38]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:50:25.977994' WHERE "rooler_rules"."id" = 38[0m [1m[35m (0.2ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 38]] [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (23))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 38]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (23)) [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:50:25.984141' WHERE "rooler_rules"."id" = 38[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 38]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.7ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."id" IN (23)[0m [["rule_id", 38]] [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.1ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.9ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 43]] [1m[35mRooler::Rule Load (0.9ms)[0m 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 [1m[36mSQL (1.1ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 11:50:26.104150' WHERE "rooler_deliveries"."id" = 20[0m [1m[35mRooler::Delivery Load (1.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 20]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 45]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:50:26.134689' WHERE "rooler_rules"."id" = 45 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mFoo Load (0.7ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1[0m [["id", 24]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.9ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.6ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (1.1ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 49]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:54:17.513538' WHERE "rooler_rules"."id" = 49[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 49]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (26))[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:54:17.519224' WHERE "rooler_rules"."id" = 49 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 51]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:54:17.565308' WHERE "rooler_rules"."id" = 51 [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 52]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:54:17.572817' WHERE "rooler_rules"."id" = 52[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 51]] [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 51]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (29))[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 52]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 52]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 52]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 53]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:54:17.604598' WHERE "rooler_rules"."id" = 53[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 53]] [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (31))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 53]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (31)) [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:54:17.610867' WHERE "rooler_rules"."id" = 53[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (1.1ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 11:54:17.707068' WHERE "rooler_deliveries"."id" = 27 [1m[36mRooler::Delivery Load (0.7ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 27]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 60]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:54:17.732799' WHERE "rooler_rules"."id" = 60[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.7ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 32]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (11.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (1.5ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (2.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.6ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.2ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.9ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (1.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (2.3ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.5ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (1.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.8ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 64]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:54:42.061576' WHERE "rooler_rules"."id" = 64[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 64]] [1m[36mFoo Load (0.6ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (34))[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:54:42.068462' WHERE "rooler_rules"."id" = 64 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 66]] [1m[36mFoo Load (0.7ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.7ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:54:42.132059' WHERE "rooler_rules"."id" = 66 [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 67]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:54:42.142884' WHERE "rooler_rules"."id" = 67[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 66]] [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 66]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (37))[0m [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 67]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.8ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 67]] [1m[36m (0.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 67]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 68]] [1m[35mFoo Load (1.0ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:54:42.193052' WHERE "rooler_rules"."id" = 68[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 68]] [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (39))[0m [1m[35m (1.1ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 68]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (39)) [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:54:42.202844' WHERE "rooler_rules"."id" = 68[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 68]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 68]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.7ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."id" IN (39)[0m [["rule_id", 68]] [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (2.3ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m 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]] [1m[36m (0.6ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.2ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.1ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.5ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.9ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 73]] [1m[35mRooler::Rule Load (1.0ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 11:54:42.383734' WHERE "rooler_deliveries"."id" = 34[0m [1m[35mRooler::Delivery Load (0.8ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 34]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 75]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:54:42.417786' WHERE "rooler_rules"."id" = 75 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.6ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mFoo Load (1.0ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1[0m [["id", 40]] [1m[35m (0.6ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.2ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.7ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 79]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:57:17.459737' WHERE "rooler_rules"."id" = 79[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 79]] [1m[36mFoo Load (0.6ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (42))[0m [1m[35mSQL (0.6ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:57:17.465440' WHERE "rooler_rules"."id" = 79 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 81]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:57:17.514845' WHERE "rooler_rules"."id" = 81 [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 82]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:57:17.522402' WHERE "rooler_rules"."id" = 82[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 81]] [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 81]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (45))[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 82]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 82]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 82]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 83]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:57:17.554951' WHERE "rooler_rules"."id" = 83[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 83]] [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (47))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 83]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (47)) [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:57:17.561040' WHERE "rooler_rules"."id" = 83[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 83]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'[0m [1m[35mRooler::Delivery Load (0.7ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."id" IN (47) [["rule_id", 83]] [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 83]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."id" IN (47) [["rule_id", 83]] [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.5ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (0.5ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 11:57:17.686713' WHERE "rooler_deliveries"."id" = 41 [1m[36mRooler::Delivery Load (0.8ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 41]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 90]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:57:17.715780' WHERE "rooler_rules"."id" = 90[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (1.1ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 48]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.2ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.7ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 94]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:57:41.448244' WHERE "rooler_rules"."id" = 94[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 94]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (50))[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:57:41.453684' WHERE "rooler_rules"."id" = 94 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 96]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:57:41.498567' WHERE "rooler_rules"."id" = 96 [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 97]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:57:41.506355' WHERE "rooler_rules"."id" = 97[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 96]] [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 96]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (53))[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 97]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 97]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 97]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 98]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:57:41.538614' WHERE "rooler_rules"."id" = 98[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 98]] [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (55))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 98]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (55)) [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:57:41.544924' WHERE "rooler_rules"."id" = 98[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 98]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'[0m [1m[35mRooler::Delivery Load (0.5ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 98]] [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 98]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'[0m [1m[35mRooler::Delivery Load (0.6ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."id" IN (55) [["rule_id", 98]] [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (1.0ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 11:57:41.671115' WHERE "rooler_deliveries"."id" = 48 [1m[36mRooler::Delivery Load (1.1ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 48]] [1m[35m (0.4ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 105]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:57:41.698827' WHERE "rooler_rules"."id" = 105[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (1.1ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 56]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.1ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (3.6ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.7ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (2.1ms)[0m 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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 109]] [1m[35mFoo Load (0.7ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:58:11.547176' WHERE "rooler_rules"."id" = 109[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.6ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 109]] [1m[36mFoo Load (0.6ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (58))[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:58:11.554415' WHERE "rooler_rules"."id" = 109 [1m[36m (0.6ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.3ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 111]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:58:11.600785' WHERE "rooler_rules"."id" = 111 [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 112]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:58:11.608421' WHERE "rooler_rules"."id" = 112[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 111]] [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 111]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (61))[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 112]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 112]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 112]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 113]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:58:11.640653' WHERE "rooler_rules"."id" = 113[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 113]] [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (63))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 113]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (63)) [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:58:11.646828' WHERE "rooler_rules"."id" = 113[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 113]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'[0m [1m[35mRooler::Delivery Load (0.5ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 113]] [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 113]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'[0m [1m[35mRooler::Delivery Load (0.6ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."id" IN (63) [["rule_id", 113]] [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.9ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (1.1ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (0.5ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 11:58:11.792635' WHERE "rooler_deliveries"."id" = 55 [1m[36mRooler::Delivery Load (0.7ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 55]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 120]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:58:11.823652' WHERE "rooler_rules"."id" = 120[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.5ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (1.3ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 64]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.6ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.7ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.4ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.2ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 124]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:58:59.525543' WHERE "rooler_rules"."id" = 124[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 124]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (66))[0m [1m[35mSQL (0.3ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:58:59.530526' WHERE "rooler_rules"."id" = 124 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 126]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:58:59.581445' WHERE "rooler_rules"."id" = 126 [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 127]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:58:59.592201' WHERE "rooler_rules"."id" = 127[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 126]] [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 126]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (69))[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 127]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 127]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 127]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 128]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:58:59.631750' WHERE "rooler_rules"."id" = 128[0m [1m[35m (0.2ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 128]] [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (71))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 128]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (71)) [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:58:59.639406' WHERE "rooler_rules"."id" = 128[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 128]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 128]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.5ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (71)[0m [["rule_id", 128]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 61]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 71[0m [["active", true], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 128]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:58:59.670811' WHERE "rooler_rules"."id" = 128 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.0ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (1.1ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (0.5ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 11:58:59.783612' WHERE "rooler_deliveries"."id" = 63 [1m[36mRooler::Delivery Load (0.7ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 63]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.3ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 135]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:58:59.816310' WHERE "rooler_rules"."id" = 135[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (1.1ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (1.7ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 72]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (8.4ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.5ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.1ms)[0m [1mSELECT 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[0m [1m[35mSQL (2.0ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.6ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (1.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 139]] [1m[35mFoo Load (0.8ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.7ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:59:10.369741' WHERE "rooler_rules"."id" = 139[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 139]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (74))[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:59:10.375372' WHERE "rooler_rules"."id" = 139 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 141]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:59:10.420752' WHERE "rooler_rules"."id" = 141 [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 142]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:59:10.429330' WHERE "rooler_rules"."id" = 142[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 141]] [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 141]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (77))[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 142]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 142]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 142]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 143]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:59:10.461279' WHERE "rooler_rules"."id" = 143[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 143]] [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (79))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 143]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (79)) [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:59:10.467622' WHERE "rooler_rules"."id" = 143[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 143]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.7ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (79)[0m [["rule_id", 143]] [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 69]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 79[0m [["active", true], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 143]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:59:10.494885' WHERE "rooler_rules"."id" = 143 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.2ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.8ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (1.0ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 11:59:10.587182' WHERE "rooler_deliveries"."id" = 71 [1m[36mRooler::Delivery Load (1.3ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 71]] [1m[35m (0.4ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 150]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:59:10.615429' WHERE "rooler_rules"."id" = 150[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.5ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.8ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 80]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.6ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.5ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.6ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 154]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:08.836046' WHERE "rooler_rules"."id" = 154[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 154]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (82))[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:08.841466' WHERE "rooler_rules"."id" = 154 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 156]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:08.890455' WHERE "rooler_rules"."id" = 156 [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 157]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:08.898927' WHERE "rooler_rules"."id" = 157[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 156]] [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 156]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (85))[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 157]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 157]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 157]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 158]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:08.932331' WHERE "rooler_rules"."id" = 158[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 158]] [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (87))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 158]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (87)) [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:08.938906' WHERE "rooler_rules"."id" = 158[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 158]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.7ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (87)[0m [["rule_id", 158]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 77]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 87[0m [["active", true], ["updated_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 158]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:08.967438' WHERE "rooler_rules"."id" = 158 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (0.5ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 12:05:09.065639' WHERE "rooler_deliveries"."id" = 79 [1m[36mRooler::Delivery Load (0.7ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 79]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 12:05:09 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 12:05:09 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 165]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:09.090774' WHERE "rooler_rules"."id" = 165[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.8ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 88]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries -------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 166]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.5ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:09.152371' WHERE "rooler_rules"."id" = 166 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.8ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (1.0ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 170]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:46.435708' WHERE "rooler_rules"."id" = 170[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 170]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (91))[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:46.441109' WHERE "rooler_rules"."id" = 170 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 172]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:46.486915' WHERE "rooler_rules"."id" = 172 [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 173]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:46.494563' WHERE "rooler_rules"."id" = 173[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 172]] [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 172]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (94))[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 173]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 173]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 173]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 174]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:46.526731' WHERE "rooler_rules"."id" = 174[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 174]] [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (96))[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 174]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (96)) [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:46.533102' WHERE "rooler_rules"."id" = 174[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 174]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.6ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (96)[0m [["rule_id", 174]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 86]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 96[0m [["active", true], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 174]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:46.558091' WHERE "rooler_rules"."id" = 174 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.2ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.8ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (1.0ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 12:05:46.648243' WHERE "rooler_deliveries"."id" = 88 [1m[36mRooler::Delivery Load (0.7ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 88]] [1m[35m (0.4ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 181]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:46.675432' WHERE "rooler_rules"."id" = 181[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.7ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 97]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries -------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 182]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:46.736079' WHERE "rooler_rules"."id" = 182 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m 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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.1ms)[0m [1mSELECT 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[0m [1m[35mSQL (2.0ms)[0m 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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.9ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.5ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 186]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:58.172890' WHERE "rooler_rules"."id" = 186[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 186]] [1m[36mFoo Load (0.6ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (100))[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:58.178574' WHERE "rooler_rules"."id" = 186 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 188]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:58.228060' WHERE "rooler_rules"."id" = 188 [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 189]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:58.235983' WHERE "rooler_rules"."id" = 189[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 188]] [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 188]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (103))[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 189]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 189]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 189]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 190]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:58.272246' WHERE "rooler_rules"."id" = 190[0m [1m[35m (0.2ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 190]] [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (105))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 190]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (105)) [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:58.278171' WHERE "rooler_rules"."id" = 190[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 190]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.6ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (105)[0m [["rule_id", 190]] [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 95]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 105[0m [["active", true], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 190]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:58.304955' WHERE "rooler_rules"."id" = 190 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.9ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (0.9ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 12:05:58.395243' WHERE "rooler_deliveries"."id" = 97 [1m[36mRooler::Delivery Load (1.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 97]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 197]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:58.422167' WHERE "rooler_rules"."id" = 197[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.5ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.7ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 106]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries -------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 198]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.5ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:58.481034' WHERE "rooler_rules"."id" = 198 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.3ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 198]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'[0m [1m[35mRooler::Delivery Load (0.6ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (107) [["rule_id", 198]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 99]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (9.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.5ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.1ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.9ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.5ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (2.6ms)[0m 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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.4ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (1.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 202]] [1m[35mFoo Load (1.0ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 13:22:38.503974' WHERE "rooler_rules"."id" = 202[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 202]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (109))[0m [1m[35mSQL (0.6ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 13:22:38.509642' WHERE "rooler_rules"."id" = 202 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.1ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 204]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 13:22:38.556576' WHERE "rooler_rules"."id" = 204 [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 205]] [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 13:22:38.564842' WHERE "rooler_rules"."id" = 205[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 204]] [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 204]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (112))[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 205]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 205]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 205]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 206]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 13:22:38.597445' WHERE "rooler_rules"."id" = 206[0m [1m[35m (0.2ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 206]] [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (114))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 206]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (114)) [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 13:22:38.603498' WHERE "rooler_rules"."id" = 206[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 206]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.7ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (114)[0m [["rule_id", 206]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 104]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 114[0m [["active", true], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 206]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 13:22:38.628316' WHERE "rooler_rules"."id" = 206 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (0.9ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 13:22:38.720559' WHERE "rooler_deliveries"."id" = 106 [1m[36mRooler::Delivery Load (1.0ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 106]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 213]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 13:22:38.746371' WHERE "rooler_rules"."id" = 213[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.8ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 115]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries -------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 214]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.5ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 13:22:38.805996' WHERE "rooler_rules"."id" = 214 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 214]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'[0m [1m[35mRooler::Delivery Load (0.6ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (116) [["rule_id", 214]] [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 108]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (28.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.0ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.3ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.5ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 218]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:20:02.995127' WHERE "rooler_rules"."id" = 218[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 218]] [1m[36mFoo Load (0.6ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (118))[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:20:03.000384' WHERE "rooler_rules"."id" = 218 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 220]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:20:03.047462' WHERE "rooler_rules"."id" = 220 [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 221]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.7ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:20:03.057932' WHERE "rooler_rules"."id" = 221[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 220]] [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 220]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (121))[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 221]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 221]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 221]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 222]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:20:03.090715' WHERE "rooler_rules"."id" = 222[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 222]] [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (123))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 222]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (123)) [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:20:03.098055' WHERE "rooler_rules"."id" = 222[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 222]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.7ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (123)[0m [["rule_id", 222]] [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 113]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 123[0m [["active", true], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 222]] [1m[36mFoo Load (0.6ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:20:03.125779' WHERE "rooler_rules"."id" = 222 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.5ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (0.5ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 16:20:03.236075' WHERE "rooler_deliveries"."id" = 115 [1m[36mRooler::Delivery Load (0.7ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 115]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.8ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 230]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:20:03.263312' WHERE "rooler_rules"."id" = 230[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.8ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 124]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries -------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 231]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:20:03.330977' WHERE "rooler_rules"."id" = 231 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.4ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 231]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'[0m [1m[35mRooler::Delivery Load (0.7ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (125) [["rule_id", 231]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 117]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (8.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.6ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.6ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 235]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:22:20.526501' WHERE "rooler_rules"."id" = 235[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 235]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (127))[0m [1m[35mSQL (0.6ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:22:20.531852' WHERE "rooler_rules"."id" = 235 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 237]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:22:20.579006' WHERE "rooler_rules"."id" = 237 [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 238]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:22:20.587373' WHERE "rooler_rules"."id" = 238[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 237]] [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 237]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (130))[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 238]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 238]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 238]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 239]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:22:20.620436' WHERE "rooler_rules"."id" = 239[0m [1m[35m (0.2ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 239]] [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (132))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 239]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (132)) [1m[36mSQL (0.3ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:22:20.626342' WHERE "rooler_rules"."id" = 239[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 239]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.7ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (132)[0m [["rule_id", 239]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 122]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 132[0m [["active", true], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 239]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:22:20.654098' WHERE "rooler_rules"."id" = 239 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 244]] [1m[35mRooler::Rule Load (0.9ms)[0m 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 [1m[36mSQL (1.1ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 16:22:20.759536' WHERE "rooler_deliveries"."id" = 124[0m [1m[35mRooler::Delivery Load (1.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 124]] [1m[36m (0.5ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 246]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:22:20.788056' WHERE "rooler_rules"."id" = 246 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.5ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mFoo Load (0.7ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1[0m [["id", 133]] [1m[35m (0.6ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------- RoolerTest: test_resets_resetable_deliveries -------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 247]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:22:20.852042' WHERE "rooler_rules"."id" = 247[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 134[0m [["active", false], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 247]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.6ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (134)[0m [["rule_id", 247]] [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.3ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 126]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 16:23:13 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:23:13 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 16:23:13 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:23:13 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name --------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries -------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.4ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.1ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.5ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (1.0ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 251]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:24:36.211990' WHERE "rooler_rules"."id" = 251[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 251]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (144))[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:24:36.217149' WHERE "rooler_rules"."id" = 251 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.1ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 253]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:24:36.263312' WHERE "rooler_rules"."id" = 253 [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 254]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:24:36.271103' WHERE "rooler_rules"."id" = 254[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 253]] [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 253]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (147))[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 254]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 254]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 254]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 255]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:24:36.303874' WHERE "rooler_rules"."id" = 255[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 255]] [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (149))[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 255]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (149)) [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:24:36.310698' WHERE "rooler_rules"."id" = 255[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 255]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.6ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (149)[0m [["rule_id", 255]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 131]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 149[0m [["active", true], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 255]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:24:36.336670' WHERE "rooler_rules"."id" = 255 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.2ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.5ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 260]] [1m[35mRooler::Rule Load (0.9ms)[0m 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 [1m[36mSQL (1.0ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 16:24:36.439837' WHERE "rooler_deliveries"."id" = 133[0m [1m[35mRooler::Delivery Load (1.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 133]] [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 262]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:24:36.468167' WHERE "rooler_rules"."id" = 262 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.5ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mFoo Load (0.7ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1[0m [["id", 150]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------- RoolerTest: test_resets_resetable_deliveries -------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 263]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:24:36.535684' WHERE "rooler_rules"."id" = 263[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 151[0m [["active", false], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 263]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.6ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (151)[0m [["rule_id", 263]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.3ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 135]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (3.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.7ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 267]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:25:13.856367' WHERE "rooler_rules"."id" = 267[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 267]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (153))[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:25:13.861367' WHERE "rooler_rules"."id" = 267 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 269]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:25:13.907478' WHERE "rooler_rules"."id" = 269 [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 270]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:25:13.915389' WHERE "rooler_rules"."id" = 270[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 269]] [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 269]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (156))[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 270]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 270]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 270]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 271]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:25:13.946985' WHERE "rooler_rules"."id" = 271[0m [1m[35m (0.2ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 271]] [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (158))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 271]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (158)) [1m[36mSQL (0.3ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:25:13.952723' WHERE "rooler_rules"."id" = 271[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 271]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.5ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (158)[0m [["rule_id", 271]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 140]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 158[0m [["active", true], ["updated_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 271]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:25:13.979373' WHERE "rooler_rules"."id" = 271 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.3ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.8ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.6ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (0.5ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 16:25:14.121756' WHERE "rooler_deliveries"."id" = 142 [1m[36mRooler::Delivery Load (0.7ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 142]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.4ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 16:25:14 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:25:14 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 278]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:25:14.185657' WHERE "rooler_rules"."id" = 278[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.5ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.8ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 159]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries -------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 279]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:25:14.215839' WHERE "rooler_rules"."id" = 279 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 279]] [1m[36mFoo Load (0.8ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'[0m [1m[35mRooler::Delivery Load (0.8ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (160) [["rule_id", 279]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 144]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.3ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.2ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (3.5ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.5ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 283]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:25:46.519822' WHERE "rooler_rules"."id" = 283[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 283]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (162))[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:25:46.525121' WHERE "rooler_rules"."id" = 283 [1m[36m (0.6ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 285]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:25:46.571929' WHERE "rooler_rules"."id" = 285 [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 286]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:25:46.579757' WHERE "rooler_rules"."id" = 286[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 285]] [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 285]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (165))[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 286]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 286]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 286]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 287]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:25:46.611750' WHERE "rooler_rules"."id" = 287[0m [1m[35m (0.2ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 287]] [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (167))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 287]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (167)) [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:25:46.618803' WHERE "rooler_rules"."id" = 287[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 287]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.6ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (167)[0m [["rule_id", 287]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 149]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 167[0m [["active", true], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 287]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:25:46.645547' WHERE "rooler_rules"."id" = 287 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name --------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.7ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 292]] [1m[35mRooler::Rule Load (0.8ms)[0m 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 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 16:25:46.749288' WHERE "rooler_deliveries"."id" = 151[0m [1m[35mRooler::Delivery Load (0.7ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 151]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 294]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:25:46.773975' WHERE "rooler_rules"."id" = 294 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mFoo Load (0.8ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1[0m [["id", 168]] [1m[35m (0.6ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------- RoolerTest: test_resets_resetable_deliveries -------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 295]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.7ms)[0m 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 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:25:46.838679' WHERE "rooler_rules"."id" = 295[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 169[0m [["active", false], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 295]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.7ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (169)[0m [["rule_id", 295]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 153]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (8.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.2ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.4ms)[0m 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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.7ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 299]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:27:11.270120' WHERE "rooler_rules"."id" = 299[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 299]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (171))[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:27:11.275801' WHERE "rooler_rules"."id" = 299 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 301]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:27:11.323083' WHERE "rooler_rules"."id" = 301 [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 302]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:27:11.331013' WHERE "rooler_rules"."id" = 302[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 301]] [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 301]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (174))[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 302]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 302]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 302]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 303]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:27:11.365627' WHERE "rooler_rules"."id" = 303[0m [1m[35m (0.2ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 303]] [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (176))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 303]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (176)) [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:27:11.371820' WHERE "rooler_rules"."id" = 303[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 303]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.7ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (176)[0m [["rule_id", 303]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 158]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 176[0m [["active", true], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 303]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:27:11.399175' WHERE "rooler_rules"."id" = 303 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.5ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 308]] [1m[35mRooler::Rule Load (0.9ms)[0m 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 [1m[36mSQL (1.1ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 16:27:11.505838' WHERE "rooler_deliveries"."id" = 160[0m [1m[35mRooler::Delivery Load (1.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 160]] [1m[36m (0.5ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 310]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:27:11.532698' WHERE "rooler_rules"."id" = 310 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mFoo Load (0.7ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1[0m [["id", 177]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------- RoolerTest: test_resets_resetable_deliveries -------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 311]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:27:11.596730' WHERE "rooler_rules"."id" = 311[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 178[0m [["active", false], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 311]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.5ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (178)[0m [["rule_id", 311]] [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.3ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 162]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.2ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (3.1ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 315]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:27:51.478781' WHERE "rooler_rules"."id" = 315[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 315]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (180))[0m [1m[35mSQL (0.3ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:27:51.483673' WHERE "rooler_rules"."id" = 315 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.1ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 317]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:27:51.530107' WHERE "rooler_rules"."id" = 317 [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 318]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:27:51.537838' WHERE "rooler_rules"."id" = 318[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 317]] [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 317]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (183))[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 318]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 318]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 318]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 319]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:27:51.569107' WHERE "rooler_rules"."id" = 319[0m [1m[35m (0.2ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 319]] [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (185))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 319]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (185)) [1m[36mSQL (0.3ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:27:51.574820' WHERE "rooler_rules"."id" = 319[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 319]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.6ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (185)[0m [["rule_id", 319]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 167]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 185[0m [["active", true], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 319]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:27:51.601580' WHERE "rooler_rules"."id" = 319 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name --------------------------------------------------------------------------------------- [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_rules"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (1.1ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 16:27:51.703632' WHERE "rooler_deliveries"."id" = 169 [1m[36mRooler::Delivery Load (1.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 169]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 326]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:27:51.731741' WHERE "rooler_rules"."id" = 326[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (1.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 186]] [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries -------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 327]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:27:51.799643' WHERE "rooler_rules"."id" = 327 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.3ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 327]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'[0m [1m[35mRooler::Delivery Load (0.7ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (187) [["rule_id", 327]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 171]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.9ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (11.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.1ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.4ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.2ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.8ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 331]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:30:55.300794' WHERE "rooler_rules"."id" = 331[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 331]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (189))[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:30:55.307913' WHERE "rooler_rules"."id" = 331 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 333]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:30:55.372032' WHERE "rooler_rules"."id" = 333 [1m[36mFoo Load (0.9ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 334]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:30:55.382454' WHERE "rooler_rules"."id" = 334[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 333]] [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 333]] [1m[36mFoo Load (0.6ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (192))[0m [1m[35mRooler::Rule Load (0.7ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 334]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 334]] [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 334]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 335]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:30:55.426030' WHERE "rooler_rules"."id" = 335[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 335]] [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (194))[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 335]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (194)) [1m[36mSQL (0.7ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:30:55.434532' WHERE "rooler_rules"."id" = 335[0m [1m[35m (1.1ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 335]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.8ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (194)[0m [["rule_id", 335]] [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 176]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 194[0m [["active", true], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 335]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:30:55.470161' WHERE "rooler_rules"."id" = 335 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.5ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.8ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.6ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.7ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.6ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.7ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (1.1ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (1.2ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (0.7ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 16:30:55.688653' WHERE "rooler_deliveries"."id" = 178 [1m[36mRooler::Delivery Load (1.0ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 178]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.8ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 342]] [1m[35mFoo Load (0.9ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.8ms)[0m 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 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:30:55.786873' WHERE "rooler_rules"."id" = 342[0m [1m[35m (0.6ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.9ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (1.2ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 195]] [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries -------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.7ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 343]] [1m[36mFoo Load (0.6ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.8ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:30:55.837651' WHERE "rooler_rules"."id" = 343 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.6ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 343]] [1m[36mFoo Load (0.7ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'[0m [1m[35mRooler::Delivery Load (1.1ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (196) [["rule_id", 343]] [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 180]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.6ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[36m (0.3ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (56.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (28.9ms)[0m INSERT INTO "rooler_rules" ("created_at", "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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (43.8ms)[0m [1mSELECT 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[0m [1m[35mSQL (30.0ms)[0m 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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.9ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.5ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (9.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (1.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 347]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-19 17:15:28.950408' WHERE "rooler_rules"."id" = 347[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 347]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (198))[0m [1m[35mSQL (0.6ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-19 17:15:28.955880' WHERE "rooler_rules"."id" = 347 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Wed, 19 Mar 2014 17:15:28 UTC +00:00], ["updated_at", Wed, 19 Mar 2014 17:15:28 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 349]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-19 17:15:29.025109' WHERE "rooler_rules"."id" = 349 [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 350]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-19 17:15:29.033245' WHERE "rooler_rules"."id" = 350[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00], ["updated_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 349]] [1m[35m (0.6ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 349]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (201))[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 350]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 350]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 350]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 351]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.3ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-19 17:15:29.068627' WHERE "rooler_rules"."id" = 351[0m [1m[35m (0.2ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 351]] [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (203))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 351]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (203)) [1m[36mSQL (0.3ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-19 17:15:29.074753' WHERE "rooler_rules"."id" = 351[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 351]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.5ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (203)[0m [["rule_id", 351]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 185]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 203[0m [["active", true], ["updated_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 351]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-19 17:15:29.102120' WHERE "rooler_rules"."id" = 351 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (25.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name --------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.5ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (0.6ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-19 17:15:29.288954' WHERE "rooler_deliveries"."id" = 187 [1m[36mRooler::Delivery Load (0.8ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 187]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00], ["updated_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 358]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-19 17:15:29.356943' WHERE "rooler_rules"."id" = 358[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.5ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.7ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 204]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries -------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 359]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-19 17:15:29.386408' WHERE "rooler_rules"."id" = 359 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (53.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 359]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'[0m [1m[35mRooler::Delivery Load (0.7ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (205) [["rule_id", 359]] [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 189]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (32.2ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.2ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.4ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.4ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 363]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:38:14.105708' WHERE "rooler_rules"."id" = 363[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 363]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (207))[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:38:14.110486' WHERE "rooler_rules"."id" = 363 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 365]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:38:14.186610' WHERE "rooler_rules"."id" = 365 [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 366]] [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:38:14.196132' WHERE "rooler_rules"."id" = 366[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.8ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 365]] [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 365]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (210))[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 366]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 366]] [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 366]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 367]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:38:14.231082' WHERE "rooler_rules"."id" = 367[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 367]] [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (212))[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 367]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (212)) [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:38:14.237462' WHERE "rooler_rules"."id" = 367[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 367]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.6ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (212)[0m [["rule_id", 367]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 194]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 212[0m [["active", true], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 367]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:38:14.263569' WHERE "rooler_rules"."id" = 367 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (0.8ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-20 14:38:14.436234' WHERE "rooler_deliveries"."id" = 196 [1m[36mRooler::Delivery Load (0.8ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 196]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 374]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:38:14.504566' WHERE "rooler_rules"."id" = 374[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.5ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.7ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 213]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries -------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 375]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (53.4ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:38:14.588880' WHERE "rooler_rules"."id" = 375 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 375]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'[0m [1m[35mRooler::Delivery Load (0.7ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (214) [["rule_id", 375]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 198]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (8.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.3ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.9ms)[0m INSERT 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.6ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.6ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 379]] [1m[35mFoo Load (1.0ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:42:35.413857' WHERE "rooler_rules"."id" = 379[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 379]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (216))[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:42:35.419250' WHERE "rooler_rules"."id" = 379 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 381]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:42:35.467717' WHERE "rooler_rules"."id" = 381 [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 382]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:42:35.475913' WHERE "rooler_rules"."id" = 382[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 381]] [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 381]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (219))[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 382]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 382]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 382]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 383]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:42:35.509288' WHERE "rooler_rules"."id" = 383[0m [1m[35m (0.2ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 383]] [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (221))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 383]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (221)) [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:42:35.515275' WHERE "rooler_rules"."id" = 383[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 383]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.6ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (221)[0m [["rule_id", 383]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 203]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 221[0m [["active", true], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 383]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:42:35.541490' WHERE "rooler_rules"."id" = 383 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name --------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules -------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.8ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1[0m [["template_id", 414]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mFoo Load (0.7ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1[0m [1m[35m (0.4ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.7ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.5ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 389]] [1m[35mRooler::Rule Load (1.0ms)[0m 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 [1m[36mSQL (1.1ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-20 14:42:35.820292' WHERE "rooler_deliveries"."id" = 205[0m [1m[35mRooler::Delivery Load (0.7ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 205]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 391]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:42:35.908592' WHERE "rooler_rules"."id" = 391 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.5ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mFoo Load (0.8ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1[0m [["id", 224]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------- RoolerTest: test_resets_resetable_deliveries -------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 392]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:42:35.935310' WHERE "rooler_rules"."id" = 392[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 225[0m [["active", false], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 392]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.6ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (225)[0m [["rule_id", 392]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.3ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 207]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.5ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.2ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.1ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.8ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 396]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:45:30.467025' WHERE "rooler_rules"."id" = 396[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 396]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (227))[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:45:30.471843' WHERE "rooler_rules"."id" = 396 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 398]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:45:30.517729' WHERE "rooler_rules"."id" = 398 [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 399]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:45:30.526531' WHERE "rooler_rules"."id" = 399[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 398]] [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 398]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (230))[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 399]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 399]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 399]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 400]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:45:30.560149' WHERE "rooler_rules"."id" = 400[0m [1m[35m (0.2ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 400]] [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (232))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 400]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (232)) [1m[36mSQL (0.3ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:45:30.566125' WHERE "rooler_rules"."id" = 400[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 400]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.7ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (232)[0m [["rule_id", 400]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 212]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 232[0m [["active", true], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 400]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:45:30.591777' WHERE "rooler_rules"."id" = 400 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules -------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1[0m [["template_id", 433]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1 [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.8ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (0.5ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-20 14:45:30.807838' WHERE "rooler_deliveries"."id" = 214 [1m[36mRooler::Delivery Load (0.7ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 214]] [1m[35m (0.4ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 408]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:45:30.888736' WHERE "rooler_rules"."id" = 408[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.8ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 235]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries -------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 409]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:45:30.916513' WHERE "rooler_rules"."id" = 409 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.3ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 409]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'[0m [1m[35mRooler::Delivery Load (0.6ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (236) [["rule_id", 409]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 216]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (3.0ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.7ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (1.1ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 413]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:46:20.867684' WHERE "rooler_rules"."id" = 413[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 413]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (238))[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:46:20.872725' WHERE "rooler_rules"."id" = 413 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.1ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 415]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:46:20.918804' WHERE "rooler_rules"."id" = 415 [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 416]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:46:20.927027' WHERE "rooler_rules"."id" = 416[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.8ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 415]] [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 415]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (241))[0m [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 416]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 416]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 416]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 417]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:46:20.962080' WHERE "rooler_rules"."id" = 417[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 417]] [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (243))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 417]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (243)) [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:46:20.967983' WHERE "rooler_rules"."id" = 417[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 417]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.8ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (243)[0m [["rule_id", 417]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 221]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 243[0m [["active", true], ["updated_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 417]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:46:20.994578' WHERE "rooler_rules"."id" = 417 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name --------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules -------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.8ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1[0m [["template_id", 452]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:46:21 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:46:21 UTC +00:00]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1 [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.7ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.8ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (0.5ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-20 14:46:21.210232' WHERE "rooler_deliveries"."id" = 223 [1m[36mRooler::Delivery Load (0.7ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 223]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:46:21 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:46:21 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 425]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:46:21.298974' WHERE "rooler_rules"."id" = 425[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.7ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 246]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries -------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 426]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:46:21.324449' WHERE "rooler_rules"."id" = 426 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.3ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 426]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'[0m [1m[35mRooler::Delivery Load (0.6ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (247) [["rule_id", 426]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 225]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.0ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.7ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (1.0ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 430]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:47:09.951374' WHERE "rooler_rules"."id" = 430[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 430]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (249))[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:47:09.956973' WHERE "rooler_rules"."id" = 430 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:47:09 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:47:09 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 432]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:47:10.005355' WHERE "rooler_rules"."id" = 432 [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 433]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:47:10.013152' WHERE "rooler_rules"."id" = 433[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.8ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 432]] [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 432]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (252))[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 433]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 433]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 433]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 434]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:47:10.045920' WHERE "rooler_rules"."id" = 434[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 434]] [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (254))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 434]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (254)) [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:47:10.052137' WHERE "rooler_rules"."id" = 434[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 434]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.6ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (254)[0m [["rule_id", 434]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 230]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 254[0m [["active", true], ["updated_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 434]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:47:10.077245' WHERE "rooler_rules"."id" = 434 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules -------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1[0m [["template_id", 471]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1[0m [1m[35m (0.6ms)[0m ROLLBACK [1m[36m (0.3ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.7ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.5ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 440]] [1m[35mRooler::Rule Load (1.0ms)[0m 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 [1m[36mSQL (1.2ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-20 14:47:10.294608' WHERE "rooler_deliveries"."id" = 232[0m [1m[35mRooler::Delivery Load (0.8ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 232]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (58.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 442]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:47:10.379736' WHERE "rooler_rules"."id" = 442 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mFoo Load (0.8ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1[0m [["id", 257]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------- RoolerTest: test_resets_resetable_deliveries -------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 443]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:47:10.405394' WHERE "rooler_rules"."id" = 443[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 258[0m [["active", false], ["updated_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 443]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.6ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (258)[0m [["rule_id", 443]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 234]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (3.2ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 447]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:48:08.925245' WHERE "rooler_rules"."id" = 447[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 447]] [1m[36mFoo Load (0.6ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (260))[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:48:08.930527' WHERE "rooler_rules"."id" = 447 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:48:08 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:48:08 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.5ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (1.8ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 449]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.9ms)[0m INSERT 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:48:08.996069' WHERE "rooler_rules"."id" = 449 [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 450]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:48:09.008490' WHERE "rooler_rules"."id" = 450[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.8ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 449]] [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 449]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (263))[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 450]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 450]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 450]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.8ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 451]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:48:09.054616' WHERE "rooler_rules"."id" = 451[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 451]] [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (265))[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.6ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 451]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (265)) [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:48:09.063428' WHERE "rooler_rules"."id" = 451[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 451]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.8ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (265)[0m [["rule_id", 451]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 239]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 265[0m [["active", true], ["updated_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 451]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:48:09.092372' WHERE "rooler_rules"."id" = 451 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules -------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1[0m [["template_id", 490]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Template Load (0.7ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" WHERE "rooler_templates"."id" = $1 LIMIT 1[0m [["id", 490]] [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 490]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.3ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 457]] [1m[35mRooler::Rule Load (0.9ms)[0m 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 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-20 14:48:09.312001' WHERE "rooler_deliveries"."id" = 241[0m [1m[35mRooler::Delivery Load (0.7ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 241]] [1m[36m (0.6ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 459]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:48:09.394756' WHERE "rooler_rules"."id" = 459 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mFoo Load (0.8ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1[0m [["id", 268]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------- RoolerTest: test_resets_resetable_deliveries -------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 460]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:48:09.420787' WHERE "rooler_rules"."id" = 460[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 269[0m [["active", false], ["updated_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 460]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.8ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (269)[0m [["rule_id", 460]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 243]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.7ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.4ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.7ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (1.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 464]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:49:42.124271' WHERE "rooler_rules"."id" = 464[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 464]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (271))[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:49:42.129425' WHERE "rooler_rules"."id" = 464 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 466]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:49:42.177442' WHERE "rooler_rules"."id" = 466 [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 467]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:49:42.185265' WHERE "rooler_rules"."id" = 467[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 466]] [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 466]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (274))[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 467]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 467]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 467]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 468]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:49:42.218453' WHERE "rooler_rules"."id" = 468[0m [1m[35m (0.2ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 468]] [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (276))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 468]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (276)) [1m[36mSQL (0.3ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:49:42.224451' WHERE "rooler_rules"."id" = 468[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 468]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.7ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (276)[0m [["rule_id", 468]] [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 248]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 276[0m [["active", true], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 468]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:49:42.251041' WHERE "rooler_rules"."id" = 468 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.3ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules -------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.8ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1[0m [["template_id", 509]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Template Load (0.7ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" WHERE "rooler_templates"."id" = $1 LIMIT 1[0m [["id", 509]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 509]] [1m[36mRooler::Template Load (0.6ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" WHERE "rooler_templates"."id" = $1 LIMIT 1[0m [["id", 509]] [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 509]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1[0m [1m[35m (0.4ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 474]] [1m[35mRooler::Rule Load (1.0ms)[0m 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 [1m[36mSQL (1.1ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-20 14:49:42.538927' WHERE "rooler_deliveries"."id" = 250[0m [1m[35mRooler::Delivery Load (1.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 250]] [1m[36m (0.5ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 476]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:49:42.566825' WHERE "rooler_rules"."id" = 476 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mFoo Load (0.7ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1[0m [["id", 279]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------- RoolerTest: test_resets_resetable_deliveries -------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 477]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:49:42.596497' WHERE "rooler_rules"."id" = 477[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 280[0m [["active", false], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 477]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.6ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (280)[0m [["rule_id", 477]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 252]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (8.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.5ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.2ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.2ms)[0m INSERT 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.4ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.6ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 481]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:50:24.502746' WHERE "rooler_rules"."id" = 481[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 481]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (282))[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:50:24.508219' WHERE "rooler_rules"."id" = 481 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 483]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:50:24.555457' WHERE "rooler_rules"."id" = 483 [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 484]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:50:24.563386' WHERE "rooler_rules"."id" = 484[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 483]] [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 483]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (285))[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 484]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 484]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 484]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 485]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:50:24.598391' WHERE "rooler_rules"."id" = 485[0m [1m[35m (0.2ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 485]] [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (287))[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 485]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (287)) [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:50:24.604583' WHERE "rooler_rules"."id" = 485[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 485]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.6ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (287)[0m [["rule_id", 485]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 257]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 287[0m [["active", true], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 485]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:50:24.631200' WHERE "rooler_rules"."id" = 485 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name --------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules -------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.8ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1[0m [["template_id", 528]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Template Load (0.6ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" WHERE "rooler_templates"."id" = $1 LIMIT 1[0m [["id", 528]] [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 528]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.6ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (1.1ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (1.0ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-20 14:50:24.830309' WHERE "rooler_deliveries"."id" = 259 [1m[36mRooler::Delivery Load (1.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 259]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.2ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 493]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:50:24.912972' WHERE "rooler_rules"."id" = 493[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.5ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.7ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 290]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries -------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 494]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:50:24.937783' WHERE "rooler_rules"."id" = 494 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.3ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 494]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'[0m [1m[35mRooler::Delivery Load (0.5ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (291) [["rule_id", 494]] [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.3ms)[0m DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 261]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (11.4ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.1ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.5ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.5ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 498]] [1m[35mFoo Load (0.9ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.6ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:50:45.597923' WHERE "rooler_rules"."id" = 498[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 498]] [1m[36mFoo Load (0.6ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (293))[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:50:45.604622' WHERE "rooler_rules"."id" = 498 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 500]] [1m[36mFoo Load (0.6ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:50:45.671087' WHERE "rooler_rules"."id" = 500 [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 501]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:50:45.682289' WHERE "rooler_rules"."id" = 501[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 500]] [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 500]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (296))[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 501]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 501]] [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 501]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 502]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:50:45.725751' WHERE "rooler_rules"."id" = 502[0m [1m[35m (0.2ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 502]] [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (298))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 502]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (298)) [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:50:45.732165' WHERE "rooler_rules"."id" = 502[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 502]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.6ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (298)[0m [["rule_id", 502]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 266]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.8ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 298[0m [["active", true], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 502]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.9ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:50:45.769041' WHERE "rooler_rules"."id" = 502 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.5ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.6ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.5ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name --------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules -------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1[0m [["template_id", 547]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" WHERE "rooler_templates"."id" = $1 LIMIT 1[0m [["id", 547]] [1m[35mRooler::Rule Load (0.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 547]] [1m[36mFoo Load (1.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" WHERE "rooler_templates"."id" = $1 LIMIT 1 [["id", 547]] [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1[0m [["template_id", 547]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1 [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.6ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.7ms)[0m 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 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.6ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.8ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (0.6ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-20 14:50:46.063710' WHERE "rooler_deliveries"."id" = 268 [1m[36mRooler::Delivery Load (0.8ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 268]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:50:46 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:50:46 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 510]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:50:46.153604' WHERE "rooler_rules"."id" = 510[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.5ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.7ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 301]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries -------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 511]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:50:46.186355' WHERE "rooler_rules"."id" = 511 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 511]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'[0m [1m[35mRooler::Delivery Load (0.8ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (302) [["rule_id", 511]] [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.3ms)[0m DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 270]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.1ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.3ms)[0m INSERT 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (3.6ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 515]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:51:00.528820' WHERE "rooler_rules"."id" = 515[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 515]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (304))[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:51:00.533712' WHERE "rooler_rules"."id" = 515 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 517]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:51:00.579386' WHERE "rooler_rules"."id" = 517 [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 518]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:51:00.587261' WHERE "rooler_rules"."id" = 518[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 517]] [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 517]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (307))[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 518]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 518]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 518]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 519]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:51:00.619160' WHERE "rooler_rules"."id" = 519[0m [1m[35m (0.2ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 519]] [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (309))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 519]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (309)) [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:51:00.624986' WHERE "rooler_rules"."id" = 519[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 519]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.6ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (309)[0m [["rule_id", 519]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 275]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 309[0m [["active", true], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 519]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:51:00.651206' WHERE "rooler_rules"."id" = 519 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name --------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules -------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1[0m [["template_id", 566]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.9ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (0.6ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-20 14:51:00.841769' WHERE "rooler_deliveries"."id" = 277 [1m[36mRooler::Delivery Load (0.8ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 277]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 527]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:51:00.923065' WHERE "rooler_rules"."id" = 527[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.8ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 310]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries -------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 528]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:51:00.949094' WHERE "rooler_rules"."id" = 528 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.3ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 528]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'[0m [1m[35mRooler::Delivery Load (0.5ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (311) [["rule_id", 528]] [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.3ms)[0m DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 279]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.5ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.2ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.7ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 532]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:52:15.751945' WHERE "rooler_rules"."id" = 532[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 532]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (313))[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:52:15.757391' WHERE "rooler_rules"."id" = 532 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 534]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:52:15.805022' WHERE "rooler_rules"."id" = 534 [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 535]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:52:15.812964' WHERE "rooler_rules"."id" = 535[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 534]] [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 534]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (316))[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 535]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 535]] [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 535]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 536]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:52:15.846856' WHERE "rooler_rules"."id" = 536[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 536]] [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (318))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 536]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (318)) [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:52:15.853008' WHERE "rooler_rules"."id" = 536[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 536]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.7ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (318)[0m [["rule_id", 536]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 284]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 318[0m [["active", true], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 536]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:52:15.877961' WHERE "rooler_rules"."id" = 536 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules -------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1[0m [["template_id", 585]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.5ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (0.6ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-20 14:52:16.065246' WHERE "rooler_deliveries"."id" = 286 [1m[36mRooler::Delivery Load (0.9ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 286]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:52:16 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:52:16 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 544]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:52:16.145617' WHERE "rooler_rules"."id" = 544[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.6ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.9ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 319]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries -------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 545]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:52:16.174900' WHERE "rooler_rules"."id" = 545 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.3ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 545]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'[0m [1m[35mRooler::Delivery Load (0.7ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (320) [["rule_id", 545]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.3ms)[0m DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 288]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (9.2ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (3.3ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.9ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.7ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 549]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:52:58.028392' WHERE "rooler_rules"."id" = 549[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 549]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (322))[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:52:58.033909' WHERE "rooler_rules"."id" = 549 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 551]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:52:58.080003' WHERE "rooler_rules"."id" = 551 [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 552]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:52:58.088757' WHERE "rooler_rules"."id" = 552[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 551]] [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 551]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (325))[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 552]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 552]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 552]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 553]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:52:58.121608' WHERE "rooler_rules"."id" = 553[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 553]] [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (327))[0m [1m[35m (0.2ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 553]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (327)) [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:52:58.127970' WHERE "rooler_rules"."id" = 553[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 553]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.7ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (327)[0m [["rule_id", 553]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 293]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 327[0m [["active", true], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 553]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:52:58.154539' WHERE "rooler_rules"."id" = 553 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules -------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.8ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1[0m [["template_id", 604]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1 [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (0.7ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-20 14:52:58.329793' WHERE "rooler_deliveries"."id" = 295 [1m[36mRooler::Delivery Load (0.9ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 295]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 561]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (53.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (1.0ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:52:58.413409' WHERE "rooler_rules"."id" = 561[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.4ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.8ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 328]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries -------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 562]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:52:58.440285' WHERE "rooler_rules"."id" = 562 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.3ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 562]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'[0m [1m[35mRooler::Delivery Load (0.6ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (329) [["rule_id", 562]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 297]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (6.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.7ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.3ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (3.5ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (2.0ms)[0m 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]] [1m[36m (0.5ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.2ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 566]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:53:21.613420' WHERE "rooler_rules"."id" = 566[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 566]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (331))[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:53:21.618357' WHERE "rooler_rules"."id" = 566 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.1ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 568]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:53:21.664342' WHERE "rooler_rules"."id" = 568 [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 569]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:53:21.672511' WHERE "rooler_rules"."id" = 569[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 568]] [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 568]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (334))[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 569]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 569]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 569]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 570]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:53:21.705042' WHERE "rooler_rules"."id" = 570[0m [1m[35m (0.2ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 570]] [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (336))[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 570]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (336)) [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:53:21.711148' WHERE "rooler_rules"."id" = 570[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 570]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.7ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (336)[0m [["rule_id", 570]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 302]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 336[0m [["active", true], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 570]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:53:21.736312' WHERE "rooler_rules"."id" = 570 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.2ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules -------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1[0m [["template_id", 623]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Template Load (0.7ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" WHERE "rooler_templates"."id" = $1 LIMIT 1[0m [["id", 623]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 623]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1[0m [1m[35mRooler::Template Load (0.5ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" WHERE "rooler_templates"."id" = $1 LIMIT 1 [["id", 623]] [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1[0m [["template_id", 623]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1 [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Delivery Load (0.5ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL[0m [1m[35mRooler::Template Load (0.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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]] [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1[0m [["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 [1m[35mSQL (0.7ms)[0m UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-20 14:53:21.968015' WHERE "rooler_deliveries"."id" = 304 [1m[36mRooler::Delivery Load (0.8ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1[0m [["id", 304]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.7ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 578]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:53:21.996799' WHERE "rooler_rules"."id" = 578[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Delivery Load (0.5ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1[0m [1m[35mFoo Load (0.7ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 339]] [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries -------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 579]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.0ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:53:22.024409' WHERE "rooler_rules"."id" = 579 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.3ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 579]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'[0m [1m[35mRooler::Delivery Load (0.6ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (340) [["rule_id", 579]] [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.3ms)[0m DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 306]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.9ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.3ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (1.1ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 583]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:54:48.577266' WHERE "rooler_rules"."id" = 583[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 583]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (342))[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:54:48.582277' WHERE "rooler_rules"."id" = 583 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 585]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m INSERT 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:54:48.629444' WHERE "rooler_rules"."id" = 585 [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 586]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:54:48.637201' WHERE "rooler_rules"."id" = 586[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 585]] [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 585]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (345))[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 586]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 586]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 586]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 587]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:54:48.670432' WHERE "rooler_rules"."id" = 587[0m [1m[35m (0.2ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 587]] [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (347))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 587]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (347)) [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:54:48.676876' WHERE "rooler_rules"."id" = 587[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 587]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.6ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (347)[0m [["rule_id", 587]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 311]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 347[0m [["active", true], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 587]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:54:48.702774' WHERE "rooler_rules"."id" = 587 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.3ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules -------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1[0m [["template_id", 642]] [1m[35mFoo Load (0.7ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" WHERE "rooler_templates"."id" = $1 LIMIT 1[0m [["id", 642]] [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 642]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.5ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 593]] [1m[35mRooler::Rule Load (0.9ms)[0m 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 [1m[36mSQL (0.9ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-20 14:54:48.921325' WHERE "rooler_deliveries"."id" = 313[0m [1m[35mRooler::Delivery Load (1.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 313]] [1m[36m (0.6ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 595]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:54:49.009812' WHERE "rooler_rules"."id" = 595 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mFoo Load (0.7ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1[0m [["id", 350]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------- RoolerTest: test_resets_resetable_deliveries -------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 596]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:54:49.036591' WHERE "rooler_rules"."id" = 596[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 351[0m [["active", false], ["updated_at", Thu, 20 Mar 2014 14:54:49 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 596]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.6ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (351)[0m [["rule_id", 596]] [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.3ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 315]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.9ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.6ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 600]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:57:40.557120' WHERE "rooler_rules"."id" = 600[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 600]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (353))[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:57:40.563069' WHERE "rooler_rules"."id" = 600 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 602]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:57:40.609382' WHERE "rooler_rules"."id" = 602 [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 603]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:57:40.617179' WHERE "rooler_rules"."id" = 603[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 602]] [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 602]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (356))[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 603]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 603]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 603]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 604]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:57:40.649516' WHERE "rooler_rules"."id" = 604[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 604]] [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (358))[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 604]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (358)) [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:57:40.656100' WHERE "rooler_rules"."id" = 604[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 604]] [1m[35mFoo Load (0.3ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.7ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (358)[0m [["rule_id", 604]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 320]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 358[0m [["active", true], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 604]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:57:40.682101' WHERE "rooler_rules"."id" = 604 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules -------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.8ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1[0m [["template_id", 661]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mFoo Load (0.6ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.9ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 610]] [1m[35mRooler::Rule Load (0.8ms)[0m 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 [1m[36mSQL (1.1ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-20 14:57:40.864755' WHERE "rooler_deliveries"."id" = 322[0m [1m[35mRooler::Delivery Load (1.6ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 322]] [1m[36m (0.5ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.8ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 612]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:57:40.950451' WHERE "rooler_rules"."id" = 612 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.5ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mFoo Load (0.6ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1[0m [["id", 361]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------- RoolerTest: test_resets_resetable_deliveries -------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 613]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:57:40.976875' WHERE "rooler_rules"."id" = 613[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 362[0m [["active", false], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.3ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 613]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.7ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (362)[0m [["rule_id", 613]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.3ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 324]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.7ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (2.1ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 617]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:59:24.340442' WHERE "rooler_rules"."id" = 617[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 617]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (364))[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:59:24.346251' WHERE "rooler_rules"."id" = 617 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 619]] [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:59:24.394478' WHERE "rooler_rules"."id" = 619 [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 620]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:59:24.403831' WHERE "rooler_rules"."id" = 620[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 619]] [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 619]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (367))[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 620]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 620]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 620]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 621]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:59:24.441746' WHERE "rooler_rules"."id" = 621[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 621]] [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (369))[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 621]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (369)) [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:59:24.448456' WHERE "rooler_rules"."id" = 621[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 621]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.6ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (369)[0m [["rule_id", 621]] [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 329]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 369[0m [["active", true], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 621]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:59:24.476462' WHERE "rooler_rules"."id" = 621 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.2ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules -------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.8ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1[0m [["template_id", 680]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.3ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.9ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 627]] [1m[35mRooler::Rule Load (0.8ms)[0m 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 [1m[36mSQL (1.0ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-20 14:59:24.664335' WHERE "rooler_deliveries"."id" = 331[0m [1m[35mRooler::Delivery Load (0.9ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 331]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (49.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 629]] [1m[36mFoo Load (0.8ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.9ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:59:24.745125' WHERE "rooler_rules"."id" = 629 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mFoo Load (0.7ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1[0m [["id", 372]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------- RoolerTest: test_resets_resetable_deliveries -------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 630]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:59:24.771756' WHERE "rooler_rules"."id" = 630[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 373[0m [["active", false], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.7ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 630]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.6ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (373)[0m [["rule_id", 630]] [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.3ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 333]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (20.4ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (2.1ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.7ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.5ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.9ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.7ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (1.1ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 634]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:41:54.370676' WHERE "rooler_rules"."id" = 634[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 634]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (375))[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:41:54.376044' WHERE "rooler_rules"."id" = 634 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.6ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 636]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:41:54.446256' WHERE "rooler_rules"."id" = 636 [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 637]] [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.7ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:41:54.456743' WHERE "rooler_rules"."id" = 637[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 636]] [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 636]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (378))[0m [1m[35mRooler::Rule Load (0.7ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 637]] [1m[36mFoo Load (0.7ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 637]] [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 637]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 638]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:41:54.497281' WHERE "rooler_rules"."id" = 638[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 638]] [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (380))[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 638]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (380)) [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:41:54.505738' WHERE "rooler_rules"."id" = 638[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 638]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.7ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (380)[0m [["rule_id", 638]] [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 338]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 380[0m [["active", true], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 638]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.9ms)[0m INSERT 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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:41:54.536821' WHERE "rooler_rules"."id" = 638 [1m[36m (0.6ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.1ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules -------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.8ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1[0m [["template_id", 699]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.3ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.5ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 644]] [1m[35mRooler::Rule Load (0.8ms)[0m 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. [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 646]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:41:54.778137' WHERE "rooler_rules"."id" = 646 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mFoo Load (0.7ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1[0m [["id", 383]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------- RoolerTest: test_resets_resetable_deliveries -------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 647]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:41:54.803590' WHERE "rooler_rules"."id" = 647[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 384[0m [["active", false], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.3ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 647]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.5ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (384)[0m [["rule_id", 647]] [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.3ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 342]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (8.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.1ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.3ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.6ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.7ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 651]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:48:18.226232' WHERE "rooler_rules"."id" = 651[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 651]] [1m[36mFoo Load (0.6ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (386))[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:48:18.233563' WHERE "rooler_rules"."id" = 651 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 653]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.8ms)[0m INSERT 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:48:18.292302' WHERE "rooler_rules"."id" = 653 [1m[36mFoo Load (0.6ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 654]] [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.8ms)[0m 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 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:48:18.306673' WHERE "rooler_rules"."id" = 654[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 653]] [1m[35m (0.6ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 653]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (389))[0m [1m[35mRooler::Rule Load (0.7ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 654]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 654]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 654]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 655]] [1m[35mFoo Load (0.7ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:48:18.359673' WHERE "rooler_rules"."id" = 655[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 655]] [1m[36m (0.6ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (391))[0m [1m[35m (0.6ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 655]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (391)) [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:48:18.369194' WHERE "rooler_rules"."id" = 655[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 655]] [1m[35mFoo Load (0.7ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.9ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (391)[0m [["rule_id", 655]] [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 347]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 391[0m [["active", true], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 655]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.7ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:48:18.405559' WHERE "rooler_rules"."id" = 655 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.6ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name --------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules -------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1[0m [["template_id", 718]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mFoo Load (0.6ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.8ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.5ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (1.2ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 661]] [1m[35mRooler::Rule Load (1.0ms)[0m 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. [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 663]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.8ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:48:18.678018' WHERE "rooler_rules"."id" = 663 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.7ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mFoo Load (1.0ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1[0m [["id", 394]] [1m[35m (0.5ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------- RoolerTest: test_resets_resetable_deliveries -------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 664]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.7ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:48:18.715469' WHERE "rooler_rules"."id" = 664[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 395[0m [["active", false], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.6ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 664]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.8ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (395)[0m [["rule_id", 664]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 351]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (12.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.1ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.5ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.8ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.5ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.8ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 668]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:48:52.231642' WHERE "rooler_rules"."id" = 668[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 668]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (397))[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:48:52.238701' WHERE "rooler_rules"."id" = 668 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 670]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:48:52.298084' WHERE "rooler_rules"."id" = 670 [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 671]] [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.4ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:48:52.307268' WHERE "rooler_rules"."id" = 671[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 670]] [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 670]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (400))[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 671]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 671]] [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 671]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 672]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:48:52.346508' WHERE "rooler_rules"."id" = 672[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 672]] [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (402))[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 672]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (402)) [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:48:52.355186' WHERE "rooler_rules"."id" = 672[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 672]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.6ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (402)[0m [["rule_id", 672]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 356]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 402[0m [["active", true], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 672]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:48:52.385933' WHERE "rooler_rules"."id" = 672 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.2ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules -------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1[0m [["template_id", 737]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.5ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.9ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 678]] [1m[35mRooler::Rule Load (1.0ms)[0m 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. [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 680]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.7ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:48:52.632508' WHERE "rooler_rules"."id" = 680 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.5ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mFoo Load (0.7ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1[0m [["id", 405]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------- RoolerTest: test_resets_resetable_deliveries -------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 681]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.6ms)[0m 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 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:48:52.664782' WHERE "rooler_rules"."id" = 681[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 406[0m [["active", false], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 681]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.7ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (406)[0m [["rule_id", 681]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 360]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.6ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.6ms)[0m ROLLBACK [1m[36m (1.6ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (1.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (18.3ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (7.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (2.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (11.4ms)[0m [1mSELECT 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[0m [1m[35mSQL (9.7ms)[0m INSERT 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]] [1m[36m (7.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (6.7ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (3.6ms)[0m [1mROLLBACK[0m [1m[35m (1.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (4.3ms)[0m 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]] [1m[36m (1.6ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (4.9ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (5.3ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (2.7ms)[0m 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]] [1m[36m (1.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.9ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (4.4ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.6ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (2.2ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.6ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (2.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 685]] [1m[35mFoo Load (1.9ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (1.2ms)[0m 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 [1m[36mSQL (4.2ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.5ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (2.1ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:54:52.647057' WHERE "rooler_rules"."id" = 685[0m [1m[35m (0.6ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (1.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.7ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 685]] [1m[36mFoo Load (0.8ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (408))[0m [1m[35mSQL (1.4ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:54:52.660615' WHERE "rooler_rules"."id" = 685 [1m[36m (1.9ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.5ms)[0m ROLLBACK [1m[36m (0.3ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.8ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.0ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Fri, 21 Mar 2014 15:54:52 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:54:52 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (2.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.5ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (3.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.7ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (4.6ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (2.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.8ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.5ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.6ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (2.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (5.5ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (2.6ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (1.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (3.2ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 687]] [1m[36mFoo Load (0.7ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (13.7ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m INSERT 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]] [1m[36m (2.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (2.8ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:54:52.817908' WHERE "rooler_rules"."id" = 687 [1m[36mFoo Load (0.6ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (1.0ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 688]] [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (3.4ms)[0m 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 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (6.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (2.1ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:54:52.847040' WHERE "rooler_rules"."id" = 688[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (2.7ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Fri, 21 Mar 2014 15:54:52 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:54:52 UTC +00:00]] [1m[35m (1.5ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (4.6ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 687]] [1m[35m (1.8ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 687]] [1m[36mFoo Load (1.9ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (411))[0m [1m[35mRooler::Rule Load (1.0ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 688]] [1m[36mFoo Load (0.8ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.7ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 688]] [1m[36m (0.6ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 688]] [1m[35m (3.2ms)[0m ROLLBACK [1m[36m (1.6ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (13.7ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (3.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (2.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (3.6ms)[0m 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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (5.2ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.8ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 689]] [1m[35mFoo Load (2.6ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (3.0ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (1.0ms)[0m 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 [1m[36mSQL (3.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:54:52.977154' WHERE "rooler_rules"."id" = 689[0m [1m[35m (2.7ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 689]] [1m[36m (0.8ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (413))[0m [1m[35m (0.7ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 689]] [1m[35mFoo Load (0.7ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (413)) [1m[36mSQL (0.8ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:54:52.993309' WHERE "rooler_rules"."id" = 689[0m [1m[35m (0.8ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (5.3ms)[0m 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]] [1m[36m (4.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.7ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.6ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 689]] [1m[35mFoo Load (1.6ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (1.2ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (413)[0m [["rule_id", 689]] [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (9.8ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 365]] [1m[35m (1.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.6ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.6ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.7ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 413[0m [["active", true], ["updated_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00]] [1m[35m (1.5ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (1.1ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 689]] [1m[36mFoo Load (3.0ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (2.8ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.8ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.9ms)[0m INSERT 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]] [1m[36m (0.8ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:54:53.080216' WHERE "rooler_rules"."id" = 689 [1m[36m (0.7ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.5ms)[0m ROLLBACK [1m[36m (1.2ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (1.0ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (3.5ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (3.1ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.6ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (1.6ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (2.4ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (1.6ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.5ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (1.6ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (5.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.2ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (1.7ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (2.2ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name --------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36m (1.2ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.3ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules -------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.2ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.3ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1[0m [["template_id", 756]] [1m[35mFoo Load (0.7ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mFoo Load (0.8ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.3ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.6ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.8ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.5ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (1.5ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 695]] [1m[35mRooler::Rule Load (1.4ms)[0m 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. [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.2ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.6ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 697]] [1m[36mFoo Load (0.7ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.8ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m INSERT 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:54:53.523376' WHERE "rooler_rules"."id" = 697 [1m[36m (0.6ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (1.2ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mFoo Load (1.0ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1[0m [["id", 416]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------- RoolerTest: test_resets_resetable_deliveries -------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 698]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.8ms)[0m 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 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:54:53.566846' WHERE "rooler_rules"."id" = 698[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.2ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 417[0m [["active", false], ["updated_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.7ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.7ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 698]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (1.1ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (417)[0m [["rule_id", 698]] [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 369]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.6ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (14.2ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.5ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (3.4ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (1.0ms)[0m [1mROLLBACK[0m [1m[35m (0.8ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (4.5ms)[0m 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]] [1m[36m (0.6ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (3.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (5.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (2.5ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.6ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (3.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (4.0ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (2.1ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.5ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (5.9ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.1ms)[0m 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]] [1m[36m (5.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (1.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.2ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.6ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (3.1ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (1.0ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 702]] [1m[35mFoo Load (1.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (1.0ms)[0m 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 [1m[36mSQL (1.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (7.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (2.1ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:56:57.146051' WHERE "rooler_rules"."id" = 702[0m [1m[35m (0.7ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.6ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (5.1ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 702]] [1m[36mFoo Load (8.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (419))[0m [1m[35mSQL (3.0ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:56:57.171987' WHERE "rooler_rules"."id" = 702 [1m[36m (0.7ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (8.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (4.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (2.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (5.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (1.0ms)[0m [1mROLLBACK[0m [1m[35m (0.4ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (4.6ms)[0m 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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.6ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.5ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (3.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (4.5ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.6ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (6.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.6ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (3.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 704]] [1m[36mFoo Load (3.1ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (1.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.3ms)[0m INSERT 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]] [1m[36m (1.9ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:56:57.350914' WHERE "rooler_rules"."id" = 704 [1m[36mFoo Load (0.7ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (1.7ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 705]] [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (1.7ms)[0m 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 [1m[36mSQL (2.0ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (1.8ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:56:57.374999' WHERE "rooler_rules"."id" = 705[0m [1m[35m (2.0ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (5.0ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]] [1m[35m (3.9ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (4.9ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 704]] [1m[35m (0.8ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 704]] [1m[36mFoo Load (3.9ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (422))[0m [1m[35mRooler::Rule Load (1.7ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 705]] [1m[36mFoo Load (6.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (5.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 705]] [1m[36m (0.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 705]] [1m[35m (1.4ms)[0m ROLLBACK [1m[36m (2.4ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.6ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.6ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.8ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.2ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (1.8ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 706]] [1m[35mFoo Load (8.8ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (1.9ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (3.7ms)[0m 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 [1m[36mSQL (6.3ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:56:57.510251' WHERE "rooler_rules"."id" = 706[0m [1m[35m (4.1ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 706]] [1m[36m (6.1ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (424))[0m [1m[35m (2.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 706]] [1m[35mFoo Load (0.7ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (424)) [1m[36mSQL (3.9ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:56:57.535436' WHERE "rooler_rules"."id" = 706[0m [1m[35m (0.7ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (7.5ms)[0m 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]] [1m[36m (2.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.7ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.5ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 706]] [1m[35mFoo Load (2.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (6.8ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (424)[0m [["rule_id", 706]] [1m[35m (0.7ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (4.4ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 374]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (2.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (2.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (2.2ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 424[0m [["active", true], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (1.0ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (4.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 706]] [1m[36mFoo Load (1.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (1.7ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (2.0ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.7ms)[0m INSERT 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:56:57.628963' WHERE "rooler_rules"."id" = 706 [1m[36m (0.9ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.8ms)[0m ROLLBACK [1m[36m (0.3ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (1.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (7.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.9ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (7.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (4.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (1.5ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (2.1ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (1.5ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (2.8ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (4.4ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (2.9ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (1.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (3.3ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (3.4ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (4.4ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (2.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (2.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (2.2ms)[0m [1mROLLBACK[0m [1m[35m (3.3ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name --------------------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m 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]] [1m[36m (1.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (3.5ms)[0m SAVEPOINT active_record_1 [1m[36m (7.0ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.7ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (3.3ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (1.8ms)[0m [1mROLLBACK[0m [1m[35m (2.3ms)[0m BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules -------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.4ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.5ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.5ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (3.2ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1[0m [["template_id", 775]] [1m[35mFoo Load (0.9ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (1.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]] [1m[35m (1.0ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mFoo Load (2.1ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1[0m [1m[35m (0.4ms)[0m ROLLBACK [1m[36m (0.4ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.7ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (2.0ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (1.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.8ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.9ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (2.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.2ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.3ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.6ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (4.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.6ms)[0m INSERT 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]] [1m[36m (0.8ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.8ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (3.7ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 712]] [1m[35mRooler::Rule Load (1.6ms)[0m 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 [1m[36mSQL (0.8ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-21 15:56:58.076866' WHERE "rooler_deliveries"."id" = 376[0m [1m[35mRooler::Delivery Load (3.7ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 376]] [1m[36m (0.7ms)[0m [1mROLLBACK[0m [1m[35m (0.3ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (2.8ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (1.5ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (5.3ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (4.5ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.8ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (1.2ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 714]] [1m[36mFoo Load (4.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (9.4ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.7ms)[0m [1mSELECT 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[0m [1m[35mSQL (4.8ms)[0m INSERT 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]] [1m[36m (0.8ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (1.7ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:56:58.250339' WHERE "rooler_rules"."id" = 714 [1m[36m (2.8ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (1.1ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mFoo Load (1.7ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1[0m [["id", 427]] [1m[35m (0.4ms)[0m ROLLBACK [1m[36m (1.5ms)[0m [1mBEGIN[0m -------------------------------------------- RoolerTest: test_resets_resetable_deliveries -------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (2.0ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (5.7ms)[0m 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]] [1m[36m (0.4ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (2.4ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (5.8ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.9ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (1.8ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 715]] [1m[35mFoo Load (1.9ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.5ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (5.7ms)[0m 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 [1m[36mSQL (1.5ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (4.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:56:58.343247' WHERE "rooler_rules"."id" = 715[0m [1m[35m (11.8ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.6ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 428[0m [["active", false], ["updated_at", Fri, 21 Mar 2014 15:56:58 UTC +00:00]] [1m[35m (7.7ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (2.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (1.9ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (2.1ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 715]] [1m[35mFoo Load (3.3ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (1.2ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (428)[0m [["rule_id", 715]] [1m[35m (1.6ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 378]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (5.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (8.4ms)[0m [1mINSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (1.7ms)[0m [1mSELECT 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[0m [1m[35mSQL (1.1ms)[0m INSERT 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Template Load (1.9ms)[0m SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "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 [1m[36m (0.4ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.2ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------ [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.8ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 719]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:57:21.275465' WHERE "rooler_rules"."id" = 719[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 719]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (430))[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:57:21.282748' WHERE "rooler_rules"."id" = 719 [1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" LIMIT 1 [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays -------------------------------------------------------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 721]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:57:21.337770' WHERE "rooler_rules"."id" = 721 [1m[36mFoo Load (0.3ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 722]] [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:57:21.346785' WHERE "rooler_rules"."id" = 722[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (0.7ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1[0m [["id", 721]] [1m[35m (0.5ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 721]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (433))[0m [1m[35mRooler::Rule Load (0.5ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 722]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t')[0m [1m[35m (0.4ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 722]] [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 722]] [1m[35m (0.3ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ---------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 723]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.7ms)[0m 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 [1m[36mSQL (1.1ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:57:21.385088' WHERE "rooler_rules"."id" = 723[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 723]] [1m[36m (0.6ms)[0m [1mSELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (435))[0m [1m[35m (0.4ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.2ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 723]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (435)) [1m[36mSQL (0.4ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:57:21.392515' WHERE "rooler_rules"."id" = 723[0m [1m[35m (0.3ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.9ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.6ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36m (0.4ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 723]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.8ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (435)[0m [["rule_id", 723]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 383]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 435[0m [["active", true], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 723]] [1m[36mFoo Load (0.5ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (0.5ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:57:21.425233' WHERE "rooler_rules"."id" = 723 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.1ms)[0m ROLLBACK [1m[36m (0.1ms)[0m [1mBEGIN[0m ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil ------------------------------------------------------------------------------------------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.9ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (1.0ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Rule Load (1.2ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()) [1m[36m (0.2ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name --------------------------------------------------------------------------------------- [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36m (0.5ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m ROLLBACK TO SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.2ms)[0m BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules -------------------------------------------------------------------------- [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mRooler::Rule Load (1.0ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1[0m [["template_id", 794]] [1m[35mFoo Load (0.6ms)[0m SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1 [1m[36m (0.3ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mINSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id"[0m [["created_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1[0m [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.3ms)[0m [1mBEGIN[0m ---------------------------------------- RoolerTest: test_delivers_pending_emails ---------------------------------------- [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m INSERT INTO "rooler_rules" ("created_at", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.5ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Load (0.4ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL [1m[36mRooler::Template Load (0.8ms)[0m [1mSELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1[0m [["id", 729]] [1m[35mRooler::Rule Load (0.9ms)[0m 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 [1m[36mSQL (1.1ms)[0m [1mUPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-21 15:57:21.584910' WHERE "rooler_deliveries"."id" = 385[0m [1m[35mRooler::Delivery Load (0.9ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 385]] [1m[36m (0.3ms)[0m [1mROLLBACK[0m [1m[35m (0.1ms)[0m BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------ [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.6ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.3ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.7ms)[0m INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "rooler_deliveries" [1m[36mRooler::Rule Load (0.5ms)[0m [1mSELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())[0m [1m[35m (0.3ms)[0m SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 731]] [1m[36mFoo Load (0.4ms)[0m [1mSELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mRooler::Delivery Exists (0.6ms)[0m [1mSELECT 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[0m [1m[35mSQL (0.6ms)[0m INSERT 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35mSQL (1.9ms)[0m UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:57:21.665497' WHERE "rooler_rules"."id" = 731 [1m[36m (0.5ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Delivery Load (0.9ms)[0m SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 [1m[36mFoo Load (0.8ms)[0m [1mSELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1[0m [["id", 438]] [1m[35m (0.2ms)[0m ROLLBACK [1m[36m (0.2ms)[0m [1mBEGIN[0m -------------------------------------------- RoolerTest: test_resets_resetable_deliveries -------------------------------------------- [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mSQL (0.8ms)[0m 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]] [1m[36m (0.3ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.7ms)[0m [1mINSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"[0m [["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]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 732]] [1m[35mFoo Load (0.4ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1) [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m [1m[35mRooler::Delivery Exists (0.5ms)[0m 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 [1m[36mSQL (0.6ms)[0m [1mINSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["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]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36mSQL (0.5ms)[0m [1mUPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:57:21.698249' WHERE "rooler_rules"."id" = 732[0m [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.8ms)[0m [1mUPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 439[0m [["active", false], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]] [1m[35m (0.3ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35mRooler::Rule Load (0.4ms)[0m SELECT "rooler_rules".* FROM "rooler_rules" [1m[36m (0.3ms)[0m [1mSELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1[0m [["rule_id", 732]] [1m[35mFoo Load (0.5ms)[0m SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' [1m[36mRooler::Delivery Load (0.7ms)[0m [1mSELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (439)[0m [["rule_id", 732]] [1m[35m (0.2ms)[0m SAVEPOINT active_record_1 [1m[36mSQL (0.4ms)[0m [1mDELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1[0m [["id", 387]] [1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1 [1m[36m (0.4ms)[0m [1mSELECT COUNT(*) FROM "rooler_deliveries"[0m [1m[35m (0.2ms)[0m ROLLBACK