clark_kent 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/app/models/clark_kent/report.rb +3 -3
  3. data/app/models/clark_kent/report_email.rb +1 -1
  4. data/lib/clark_kent/version.rb +1 -1
  5. data/test/dummy/db/test.sqlite3 +0 -0
  6. data/test/dummy/log/test.log +3674 -0
  7. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/1dmI5Zo2mcXAfKVp6s6Y3ITZex2nf6M6ba87fZW3-HE.cache +1 -0
  8. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/2VXuw1t1XOVi5kuVjvemRwSnlQWo0cZP_Ial5evYROc.cache +1 -0
  9. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/5k7OtUEslUWi1MkCA5Kmc7rHAU0hWPFaSUcq7j8-doc.cache +1 -0
  10. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/7cvHRyXeQa3tRwdNOGrBZHOjELOJ4kopXU9eCd4GvVE.cache +0 -0
  11. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/9xZnfP3LysRg28xPYEclacGlxgUrof8V_jYLmG4iJko.cache +1 -0
  12. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/HuyKNAYEnPs4OFAHZ6YQZ3VSrTaxZe0Ra_fNZLbeXDw.cache +1 -0
  13. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/IwcHpmWHtyrIj83pFTlHGdyK5GSO3M0FtJd09CB88uE.cache +0 -0
  14. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/JbcAACpMmVlknG104wCtLY73aNeelGB5NNPiF4uDf5s.cache +2 -0
  15. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Mcau95NHKdhNbIQcmeAMI9dpJu0QmBrXgYBMR7dosQI.cache +0 -0
  16. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/O8akbUwAbmIKY-AhITimq-JDQ6IgsO3Hvq2v5etufFw.cache +2 -0
  17. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/UwMFS8rJmeOVTOPUAsy5rBsPqe-mwJgvTSCg-8xwSK8.cache +3 -0
  18. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/YyF0e1zDQF3_KsNy35VwTXCAZDObuR--UKKjiH9Ugs4.cache +0 -0
  19. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/c0fZzpmetAbdlEG8jam5O6N3N3wiVzKXR_lCIY6kCTA.cache +0 -0
  20. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/gbQ-9rbnxd-XmF785qDyhZk5H-HJvNbffkuHrzAos-I.cache +1 -0
  21. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/gfx6mgjf1Gygt3bclLKW8zeiMIdAUtlfAzmOraiAO0c.cache +1 -0
  22. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/hWadad6CRv-QW0lZ5DKckYD_umPsy2_WbigRqL3bjv0.cache +1 -0
  23. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/hj8Ir9wcVSy1KYrnWu9bpD24vDhCG3tvt-nKbNxb1Wg.cache +3 -0
  24. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/jQKNn92UMva5Q4nbPoJ_zjf7-gS2Z6_8IArZpjm90UA.cache +0 -0
  25. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/oCsZTGZyV4kH8Y4OeSDUdrwfkJFPzTODZjuBKZB8oGQ.cache +2 -0
  26. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/tPF6H9NRpGO3whu2y5_e_R_1EACKdCwu5437D83qJT0.cache +3 -0
  27. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/x1pNHYQUCVLQm2-2eBri2T7gxgLTBDez3d7ao8etFX4.cache +0 -0
  28. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/ye0s0eVe7TGf1M78y4llhk6PqlHaHZQIJ-_GeKxHvCE.cache +0 -0
  29. data/test/test_helper.rb +1 -0
  30. metadata +89 -3
@@ -24413,3 +24413,3677 @@ ClarkKent::ReportTest: test_can't_save_without_a_sharing_scope_id_if_the_sharing
24413
24413
  ------------------------------------------------------------------------------------------------
24414
24414
   (0.1ms) begin transaction
24415
24415
   (0.1ms) rollback transaction
24416
+  (1.1ms) CREATE TABLE "clark_kent_report_columns" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "column_name" varchar, "column_order" integer, "report_sort" varchar, "summary_method" varchar) 
24417
+  (0.1ms) select sqlite_version(*)
24418
+  (1.2ms) CREATE INDEX "index_clark_kent_report_columns_on_report_id" ON "clark_kent_report_columns" ("report_id")
24419
+  (1.1ms) CREATE TABLE "clark_kent_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "when_to_send" varchar, "name" varchar)
24420
+  (1.0ms) CREATE TABLE "clark_kent_report_filters" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "filterable_id" integer, "filterable_type" varchar DEFAULT 'ClarkKent::Report', "string" varchar DEFAULT 'ClarkKent::Report', "filter_name" varchar, "filter_value" varchar, "type" varchar, "duration" varchar, "kind_of_day" varchar, "offset" varchar, "created_at" datetime, "updated_at" datetime) 
24421
+  (0.9ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_id" ON "clark_kent_report_filters" ("filterable_id")
24422
+  (0.1ms)  SELECT sql
24423
+ FROM sqlite_master
24424
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
24425
+ UNION ALL
24426
+ SELECT sql
24427
+ FROM sqlite_temp_master
24428
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
24429
+ 
24430
+  (0.9ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_type" ON "clark_kent_report_filters" ("filterable_type")
24431
+  (0.9ms) CREATE TABLE "clark_kent_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "resource_type" varchar, "sharing_scope_type" varchar, "sharing_scope_id" integer, "created_at" datetime, "updated_at" datetime) 
24432
+  (0.9ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_id" ON "clark_kent_reports" ("sharing_scope_id")
24433
+  (0.1ms)  SELECT sql
24434
+ FROM sqlite_master
24435
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
24436
+ UNION ALL
24437
+ SELECT sql
24438
+ FROM sqlite_temp_master
24439
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
24440
+ 
24441
+  (0.8ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_type" ON "clark_kent_reports" ("sharing_scope_type")
24442
+  (0.9ms) CREATE TABLE "clark_kent_user_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "report_email_id" integer) 
24443
+  (0.8ms) CREATE TABLE "departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar)
24444
+  (0.8ms) CREATE TABLE "orders" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "amount" integer, "description" varchar, "created_at" datetime, "updated_at" datetime) 
24445
+  (0.9ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "email" varchar, "age" integer, "department_id" integer)
24446
+  (1.2ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
24447
+  (1.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
24448
+  (0.1ms) SELECT version FROM "schema_migrations"
24449
+  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20150313144015')
24450
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170042')
24451
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170112')
24452
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140114010048')
24453
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140129051754')
24454
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150304233739')
24455
+  (0.1ms) begin transaction
24456
+ SQL (0.3ms) INSERT INTO "clark_kent_reports" ("resource_type", "created_at", "updated_at") VALUES (?, ?, ?) [["resource_type", "Order"], ["created_at", "2015-10-05 16:17:31.429145"], ["updated_at", "2015-10-05 16:17:31.429145"]]
24457
+  (0.7ms) commit transaction
24458
+  (0.0ms) begin transaction
24459
+ SQL (0.4ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "user_name"], ["column_order", 1], ["report_id", 1]]
24460
+  (0.7ms) commit transaction
24461
+  (0.0ms) begin transaction
24462
+ SQL (0.2ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "id"], ["column_order", 2], ["report_id", 1]]
24463
+  (0.8ms) commit transaction
24464
+  (0.1ms) begin transaction
24465
+ SQL (0.3ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "amount"], ["column_order", 3], ["report_id", 1]]
24466
+  (0.7ms) commit transaction
24467
+  (0.0ms) begin transaction
24468
+ SQL (0.2ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "description"], ["column_order", 4], ["report_id", 1]]
24469
+  (0.7ms) commit transaction
24470
+  (0.0ms) begin transaction
24471
+ SQL (0.3ms) INSERT INTO "departments" ("name") VALUES (?) [["name", "silly walks"]]
24472
+  (0.7ms) commit transaction
24473
+  (0.0ms) begin transaction
24474
+ SQL (0.3ms) INSERT INTO "users" ("name", "email", "department_id") VALUES (?, ?, ?) [["name", "Michael Hedges"], ["email", "taproot@gmail.com"], ["department_id", 1]]
24475
+  (0.6ms) commit transaction
24476
+  (0.1ms) begin transaction
24477
+ SQL (0.3ms) INSERT INTO "orders" ("user_id", "description", "amount", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["user_id", 1], ["description", "Guitar strings"], ["amount", 1], ["created_at", "2015-10-05 16:17:31.483252"], ["updated_at", "2015-10-05 16:17:31.483252"]]
24478
+  (1.0ms) commit transaction
24479
+ -------------------------------------------------------------------
24480
+ ClarkKent::ReportableTest: test_it_adds_required_filters_if_present
24481
+ -------------------------------------------------------------------
24482
+  (0.1ms) begin transaction
24483
+ SQL (0.4ms) INSERT INTO "clark_kent_reports" ("name", "resource_type", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "test one"], ["resource_type", "Order"], ["created_at", "2015-10-05 16:17:31.536557"], ["updated_at", "2015-10-05 16:17:31.536557"]]
24484
+  (0.8ms) commit transaction
24485
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 2]]
24486
+ ClarkKent::ReportFilter Load (0.2ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 2], ["filterable_type", "ClarkKent::Report"]]
24487
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 2]]
24488
+ ---------------------------------------------------------------------
24489
+ ClarkKent::ReportableTest: test_it_works_without_any_required_filters
24490
+ ---------------------------------------------------------------------
24491
+  (0.1ms) begin transaction
24492
+ SQL (0.3ms) INSERT INTO "clark_kent_reports" ("name", "resource_type", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "test one"], ["resource_type", "TestReportable"], ["created_at", "2015-10-05 16:17:31.548046"], ["updated_at", "2015-10-05 16:17:31.548046"]]
24493
+  (0.7ms) commit transaction
24494
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 3]]
24495
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 3], ["filterable_type", "ClarkKent::Report"]]
24496
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 3]]
24497
+ ------------------------------------------------------------------------------------------------
24498
+ ClarkKent::ReportTest: test_can't_save_without_a_sharing_scope_id_if_the_sharing_scope_is_custom
24499
+ ------------------------------------------------------------------------------------------------
24500
+  (0.1ms) begin transaction
24501
+  (0.1ms) rollback transaction
24502
+ -------------------------
24503
+ ClarkKentTest: test_truth
24504
+ -------------------------
24505
+ ---------------------------------------------------
24506
+ ClarkKent::ReportEmailTest: test_sends_report_to_s3
24507
+ ---------------------------------------------------
24508
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1 [["email", "taproot@gmail.com"]]
24509
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
24510
+ SQL (1.2ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = ? [["id", 1]]
24511
+  (0.1ms) begin transaction
24512
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
24513
+  (0.7ms) commit transaction
24514
+  (0.0ms) begin transaction
24515
+ SQL (0.4ms) INSERT INTO "clark_kent_report_filters" ("type", "filter_name", "duration", "kind_of_day", "offset", "filterable_id", "filterable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["type", "ClarkKent::ReportDateFilter"], ["filter_name", "created_at"], ["duration", "week"], ["kind_of_day", "Monday"], ["offset", "this_week"], ["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"], ["created_at", "2015-10-05 16:17:31.607771"], ["updated_at", "2015-10-05 16:17:31.607771"]]
24516
+  (0.7ms) commit transaction
24517
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
24518
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
24519
+ Department Load (0.2ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
24520
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
24521
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
24522
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
24523
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
24524
+ -----------------------------------------------------------------------------------------
24525
+ ClarkKent::ReportEmailTest: test_throws_an_error_if_required_date_filters_are_not_present
24526
+ -----------------------------------------------------------------------------------------
24527
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1 [["email", "taproot@gmail.com"]]
24528
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
24529
+ SQL (1.0ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = ? [["id", 1]]
24530
+  (0.1ms) begin transaction
24531
+ SQL (0.2ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
24532
+  (0.7ms) commit transaction
24533
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
24534
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
24535
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
24536
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 2]]
24537
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 2]]
24538
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 2], ["filterable_type", "ClarkKent::Report"]]
24539
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 2]]
24540
+ -----------------------------------------------------------
24541
+ ClarkKent::ReportsControllerTest: test_should_create_report
24542
+ -----------------------------------------------------------
24543
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
24544
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
24545
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
24546
+ ------------------------------------------------------------
24547
+ ClarkKent::ReportsControllerTest: test_should_destroy_report
24548
+ ------------------------------------------------------------
24549
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
24550
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
24551
+  (0.0ms) begin transaction
24552
+ SQL (0.3ms) INSERT INTO "clark_kent_reports" ("name", "resource_type", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "delete me"], ["resource_type", "Order"], ["created_at", "2015-10-05 16:17:31.700648"], ["updated_at", "2015-10-05 16:17:31.700648"]]
24553
+  (0.6ms) commit transaction
24554
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
24555
+ ------------------------------------------------------
24556
+ ClarkKent::ReportsControllerTest: test_should_get_edit
24557
+ ------------------------------------------------------
24558
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
24559
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
24560
+ Processing by ClarkKent::ReportsController#edit as HTML
24561
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
24562
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/edit.html.erb within layouts/application (4.7ms)
24563
+ Completed 500 Internal Server Error in 17ms (ActiveRecord: 0.0ms)
24564
+ -------------------------------------------------------
24565
+ ClarkKent::ReportsControllerTest: test_should_get_index
24566
+ -------------------------------------------------------
24567
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
24568
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
24569
+ Processing by ClarkKent::ReportsController#index as HTML
24570
+ Parameters: {"current_user_id"=>"1"}
24571
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
24572
+ ClarkKent::Report Exists (0.2ms) SELECT 1 AS one FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" = ? AND "clark_kent_reports"."sharing_scope_type" = ? LIMIT 1 [["sharing_scope_id", 1], ["sharing_scope_type", "User"]]
24573
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
24574
+ ClarkKent::Report Exists (0.1ms) SELECT 1 AS one FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" = ? AND "clark_kent_reports"."sharing_scope_type" = ? LIMIT 1 [["sharing_scope_id", 1], ["sharing_scope_type", "Department"]]
24575
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" = ? AND "clark_kent_reports"."sharing_scope_type" = ? [["sharing_scope_id", 1], ["sharing_scope_type", "Department"]]
24576
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" IS NULL
24577
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" IS NULL
24578
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/index.html.erb within layouts/application (13.0ms)
24579
+ Completed 200 OK in 576ms (Views: 574.5ms | ActiveRecord: 0.8ms)
24580
+ -----------------------------------------------------
24581
+ ClarkKent::ReportsControllerTest: test_should_get_new
24582
+ -----------------------------------------------------
24583
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
24584
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
24585
+ Processing by ClarkKent::ReportsController#new as HTML
24586
+ Parameters: {"current_user_id"=>"1"}
24587
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_edit.html.erb (4.1ms)
24588
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/new.html.erb within layouts/application (9.2ms)
24589
+ Completed 500 Internal Server Error in 12ms (ActiveRecord: 0.0ms)
24590
+ ---------------------------------------------------------
24591
+ ClarkKent::ReportsControllerTest: test_should_show_report
24592
+ ---------------------------------------------------------
24593
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
24594
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
24595
+ Processing by ClarkKent::ReportsController#show as HTML
24596
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
24597
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/show.html.erb within layouts/application (2.9ms)
24598
+ Completed 500 Internal Server Error in 5ms (ActiveRecord: 0.0ms)
24599
+ -----------------------------------------------------------------
24600
+ ClarkKent::ReportsControllerTest: test_should_show_report_results
24601
+ -----------------------------------------------------------------
24602
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
24603
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
24604
+ Processing by ClarkKent::ReportsController#show as HTML
24605
+ Parameters: {"current_user_id"=>"1", "run_report"=>true, "created_at_until"=>"2015-10-05", "created_at_from"=>"2015-10-04", "id"=>"1"}
24606
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/show.html.erb within layouts/application (2.1ms)
24607
+ Completed 500 Internal Server Error in 2ms (ActiveRecord: 0.0ms)
24608
+ --------------------------------------------------------------------
24609
+ ClarkKent::ReportsControllerTest: test_should_show_report_run_errors
24610
+ --------------------------------------------------------------------
24611
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
24612
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
24613
+ Processing by ClarkKent::ReportsController#show as HTML
24614
+ Parameters: {"current_user_id"=>"1", "run_report"=>true, "id"=>"1"}
24615
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/show.html.erb within layouts/application (2.0ms)
24616
+ Completed 500 Internal Server Error in 2ms (ActiveRecord: 0.0ms)
24617
+ -----------------------------------------------------------
24618
+ ClarkKent::ReportsControllerTest: test_should_update_report
24619
+ -----------------------------------------------------------
24620
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
24621
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
24622
+  (2.0ms) CREATE TABLE "clark_kent_report_columns" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "column_name" varchar, "column_order" integer, "report_sort" varchar, "summary_method" varchar) 
24623
+  (0.1ms) select sqlite_version(*)
24624
+  (1.1ms) CREATE INDEX "index_clark_kent_report_columns_on_report_id" ON "clark_kent_report_columns" ("report_id")
24625
+  (1.1ms) CREATE TABLE "clark_kent_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "when_to_send" varchar, "name" varchar)
24626
+  (1.0ms) CREATE TABLE "clark_kent_report_filters" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "filterable_id" integer, "filterable_type" varchar DEFAULT 'ClarkKent::Report', "string" varchar DEFAULT 'ClarkKent::Report', "filter_name" varchar, "filter_value" varchar, "type" varchar, "duration" varchar, "kind_of_day" varchar, "offset" varchar, "created_at" datetime, "updated_at" datetime) 
24627
+  (0.9ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_id" ON "clark_kent_report_filters" ("filterable_id")
24628
+  (0.1ms)  SELECT sql
24629
+ FROM sqlite_master
24630
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
24631
+ UNION ALL
24632
+ SELECT sql
24633
+ FROM sqlite_temp_master
24634
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
24635
+ 
24636
+  (0.9ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_type" ON "clark_kent_report_filters" ("filterable_type")
24637
+  (0.9ms) CREATE TABLE "clark_kent_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "resource_type" varchar, "sharing_scope_type" varchar, "sharing_scope_id" integer, "created_at" datetime, "updated_at" datetime) 
24638
+  (0.8ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_id" ON "clark_kent_reports" ("sharing_scope_id")
24639
+  (0.1ms)  SELECT sql
24640
+ FROM sqlite_master
24641
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
24642
+ UNION ALL
24643
+ SELECT sql
24644
+ FROM sqlite_temp_master
24645
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
24646
+ 
24647
+  (0.9ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_type" ON "clark_kent_reports" ("sharing_scope_type")
24648
+  (0.9ms) CREATE TABLE "clark_kent_user_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "report_email_id" integer) 
24649
+  (0.9ms) CREATE TABLE "departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar)
24650
+  (0.8ms) CREATE TABLE "orders" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "amount" integer, "description" varchar, "created_at" datetime, "updated_at" datetime) 
24651
+  (11.1ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "email" varchar, "age" integer, "department_id" integer)
24652
+  (0.9ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
24653
+  (0.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
24654
+  (0.1ms) SELECT version FROM "schema_migrations"
24655
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20150313144015')
24656
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170042')
24657
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170112')
24658
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140114010048')
24659
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140129051754')
24660
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20150304233739')
24661
+  (0.1ms) begin transaction
24662
+ SQL (0.4ms) INSERT INTO "clark_kent_reports" ("resource_type", "created_at", "updated_at") VALUES (?, ?, ?) [["resource_type", "Order"], ["created_at", "2015-10-05 16:26:32.058334"], ["updated_at", "2015-10-05 16:26:32.058334"]]
24663
+  (1.0ms) commit transaction
24664
+  (0.1ms) begin transaction
24665
+ SQL (0.4ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "user_name"], ["column_order", 1], ["report_id", 1]]
24666
+  (1.0ms) commit transaction
24667
+  (0.1ms) begin transaction
24668
+ SQL (0.3ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "id"], ["column_order", 2], ["report_id", 1]]
24669
+  (0.9ms) commit transaction
24670
+  (0.1ms) begin transaction
24671
+ SQL (0.2ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "amount"], ["column_order", 3], ["report_id", 1]]
24672
+  (0.8ms) commit transaction
24673
+  (0.0ms) begin transaction
24674
+ SQL (0.2ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "description"], ["column_order", 4], ["report_id", 1]]
24675
+  (0.7ms) commit transaction
24676
+  (0.0ms) begin transaction
24677
+ SQL (0.3ms) INSERT INTO "departments" ("name") VALUES (?) [["name", "silly walks"]]
24678
+  (1.0ms) commit transaction
24679
+  (0.1ms) begin transaction
24680
+ SQL (0.3ms) INSERT INTO "users" ("name", "email", "department_id") VALUES (?, ?, ?) [["name", "Michael Hedges"], ["email", "taproot@gmail.com"], ["department_id", 1]]
24681
+  (0.8ms) commit transaction
24682
+  (0.0ms) begin transaction
24683
+ SQL (0.3ms) INSERT INTO "orders" ("user_id", "description", "amount", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["user_id", 1], ["description", "Guitar strings"], ["amount", 1], ["created_at", "2015-10-05 16:26:32.111511"], ["updated_at", "2015-10-05 16:26:32.111511"]]
24684
+  (1.0ms) commit transaction
24685
+  (1.7ms) CREATE TABLE "clark_kent_report_columns" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "column_name" varchar(255), "column_order" integer, "report_sort" varchar(255), "summary_method" varchar(255)) 
24686
+  (0.1ms) select sqlite_version(*)
24687
+  (1.2ms) CREATE INDEX "index_clark_kent_report_columns_on_report_id" ON "clark_kent_report_columns" ("report_id")
24688
+  (1.2ms) CREATE TABLE "clark_kent_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "when_to_send" varchar(255), "name" varchar(255))
24689
+  (1.1ms) CREATE TABLE "clark_kent_report_filters" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "filterable_id" integer, "filterable_type" varchar(255) DEFAULT 'ClarkKent::Report', "string" varchar(255) DEFAULT 'ClarkKent::Report', "filter_name" varchar(255), "filter_value" varchar(255), "type" varchar(255), "duration" varchar(255), "kind_of_day" varchar(255), "offset" varchar(255), "created_at" datetime, "updated_at" datetime) 
24690
+  (0.9ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_id" ON "clark_kent_report_filters" ("filterable_id")
24691
+  (0.1ms)  SELECT sql
24692
+ FROM sqlite_master
24693
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
24694
+ UNION ALL
24695
+ SELECT sql
24696
+ FROM sqlite_temp_master
24697
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
24698
+ 
24699
+  (0.9ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_type" ON "clark_kent_report_filters" ("filterable_type")
24700
+  (1.0ms) CREATE TABLE "clark_kent_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "resource_type" varchar(255), "sharing_scope_type" varchar(255), "sharing_scope_id" integer, "created_at" datetime, "updated_at" datetime) 
24701
+  (1.0ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_id" ON "clark_kent_reports" ("sharing_scope_id")
24702
+  (0.1ms)  SELECT sql
24703
+ FROM sqlite_master
24704
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
24705
+ UNION ALL
24706
+ SELECT sql
24707
+ FROM sqlite_temp_master
24708
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
24709
+ 
24710
+  (0.9ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_type" ON "clark_kent_reports" ("sharing_scope_type")
24711
+  (0.8ms) CREATE TABLE "clark_kent_user_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "report_email_id" integer) 
24712
+  (0.8ms) CREATE TABLE "departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255))
24713
+  (0.9ms) CREATE TABLE "orders" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "amount" integer, "description" varchar(255), "created_at" datetime, "updated_at" datetime) 
24714
+  (0.9ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "email" varchar(255), "age" integer, "department_id" integer)
24715
+  (0.9ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
24716
+  (0.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
24717
+  (0.1ms) SELECT version FROM "schema_migrations"
24718
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20150313144015')
24719
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170042')
24720
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170112')
24721
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140114010048')
24722
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140129051754')
24723
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150304233739')
24724
+  (0.0ms) begin transaction
24725
+ SQL (0.4ms) INSERT INTO "clark_kent_reports" ("created_at", "resource_type", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-05 16:28:35.159464"], ["resource_type", "Order"], ["updated_at", "2015-10-05 16:28:35.159464"]]
24726
+  (0.7ms) commit transaction
24727
+  (0.0ms) begin transaction
24728
+ SQL (0.3ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "user_name"], ["column_order", 1], ["report_id", 1]]
24729
+  (0.7ms) commit transaction
24730
+  (0.1ms) begin transaction
24731
+ SQL (0.2ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "id"], ["column_order", 2], ["report_id", 1]]
24732
+  (0.7ms) commit transaction
24733
+  (0.0ms) begin transaction
24734
+ SQL (0.2ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "amount"], ["column_order", 3], ["report_id", 1]]
24735
+  (0.6ms) commit transaction
24736
+  (0.2ms) begin transaction
24737
+ SQL (0.2ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "description"], ["column_order", 4], ["report_id", 1]]
24738
+  (0.8ms) commit transaction
24739
+  (0.0ms) begin transaction
24740
+ SQL (0.3ms) INSERT INTO "departments" ("name") VALUES (?) [["name", "silly walks"]]
24741
+  (0.7ms) commit transaction
24742
+  (0.0ms) begin transaction
24743
+ SQL (0.3ms) INSERT INTO "users" ("department_id", "email", "name") VALUES (?, ?, ?) [["department_id", 1], ["email", "taproot@gmail.com"], ["name", "Michael Hedges"]]
24744
+  (1.0ms) commit transaction
24745
+  (0.0ms) begin transaction
24746
+ SQL (0.3ms) INSERT INTO "orders" ("amount", "created_at", "description", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["amount", 1], ["created_at", "2015-10-05 16:28:35.216054"], ["description", "Guitar strings"], ["updated_at", "2015-10-05 16:28:35.216054"], ["user_id", 1]]
24747
+  (0.6ms) commit transaction
24748
+ -----------------------------------------------------------
24749
+ ClarkKent::ReportsControllerTest: test_should_create_report
24750
+ -----------------------------------------------------------
24751
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
24752
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
24753
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
24754
+ Processing by ClarkKent::ReportsController#create as HTML
24755
+ Parameters: {"report"=>{"name"=>"delete me", "resource_type"=>"Order", "sharing_scope_id"=>nil, "sharing_scope_type"=>nil}, "current_user_id"=>"1"}
24756
+  (0.1ms) begin transaction
24757
+ SQL (0.3ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-10-05 16:28:35.272242"], ["name", "delete me"], ["resource_type", "Order"], ["updated_at", "2015-10-05 16:28:35.272242"]]
24758
+  (0.7ms) commit transaction
24759
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (3.5ms)
24760
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 2], ["filterable_type", "ClarkKent::Report"]]
24761
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_index.html.erb (4.7ms)
24762
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 2]]
24763
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_index.html.erb (2.0ms)
24764
+ ClarkKent::ReportEmail Load (0.1ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 2]]
24765
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_index.html.erb (8.1ms)
24766
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/edit.html.erb within layouts/application (32.5ms)
24767
+ Completed 200 OK in 185ms (Views: 181.8ms | ActiveRecord: 1.8ms)
24768
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
24769
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."name" = 'delete me' LIMIT 1
24770
+  (0.0ms) begin transaction
24771
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 2], ["filterable_type", "ClarkKent::Report"]]
24772
+ ClarkKent::ReportColumn Load (0.0ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 2]]
24773
+ ClarkKent::ReportEmail Load (0.0ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 2]]
24774
+ SQL (0.2ms) DELETE FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? [["id", 2]]
24775
+  (1.3ms) commit transaction
24776
+ ------------------------------------------------------------
24777
+ ClarkKent::ReportsControllerTest: test_should_destroy_report
24778
+ ------------------------------------------------------------
24779
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
24780
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
24781
+  (0.0ms) begin transaction
24782
+ SQL (0.3ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-10-05 16:28:35.465794"], ["name", "delete me"], ["resource_type", "Order"], ["updated_at", "2015-10-05 16:28:35.465794"]]
24783
+  (0.8ms) commit transaction
24784
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
24785
+ Processing by ClarkKent::ReportsController#destroy as HTML
24786
+ Parameters: {"current_user_id"=>"1", "id"=>"3"}
24787
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 3]]
24788
+  (0.0ms) begin transaction
24789
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 3], ["filterable_type", "ClarkKent::Report"]]
24790
+ ClarkKent::ReportColumn Load (0.0ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 3]]
24791
+ ClarkKent::ReportEmail Load (0.0ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 3]]
24792
+ SQL (0.2ms) DELETE FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? [["id", 3]]
24793
+  (0.5ms) commit transaction
24794
+ Redirected to http://test.host/reports/reports
24795
+ Completed 302 Found in 4ms (ActiveRecord: 1.1ms)
24796
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
24797
+ ------------------------------------------------------
24798
+ ClarkKent::ReportsControllerTest: test_should_get_edit
24799
+ ------------------------------------------------------
24800
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
24801
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
24802
+ Processing by ClarkKent::ReportsController#edit as HTML
24803
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
24804
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
24805
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (0.8ms)
24806
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
24807
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_index.html.erb (1.1ms)
24808
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
24809
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (1.1ms)
24810
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (5.5ms)
24811
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.3ms)
24812
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.5ms)
24813
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.3ms)
24814
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.5ms)
24815
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.3ms)
24816
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.5ms)
24817
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_index.html.erb (10.9ms)
24818
+ ClarkKent::ReportEmail Load (0.1ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 1]]
24819
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_index.html.erb (1.1ms)
24820
+ Completed 200 OK in 18ms (Views: 16.9ms | ActiveRecord: 0.3ms)
24821
+ -------------------------------------------------------
24822
+ ClarkKent::ReportsControllerTest: test_should_get_index
24823
+ -------------------------------------------------------
24824
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
24825
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
24826
+ Processing by ClarkKent::ReportsController#index as HTML
24827
+ Parameters: {"current_user_id"=>"1"}
24828
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
24829
+ ClarkKent::Report Exists (0.2ms) SELECT 1 AS one FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" = ? AND "clark_kent_reports"."sharing_scope_type" = ? LIMIT 1 [["sharing_scope_id", 1], ["sharing_scope_type", "User"]]
24830
+ Department Load (0.3ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
24831
+ ClarkKent::Report Exists (0.1ms) SELECT 1 AS one FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" = ? AND "clark_kent_reports"."sharing_scope_type" = ? LIMIT 1 [["sharing_scope_id", 1], ["sharing_scope_type", "Department"]]
24832
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" IS NULL
24833
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" IS NULL
24834
+ Completed 200 OK in 20ms (Views: 18.6ms | ActiveRecord: 1.0ms)
24835
+ -----------------------------------------------------
24836
+ ClarkKent::ReportsControllerTest: test_should_get_new
24837
+ -----------------------------------------------------
24838
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
24839
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
24840
+ Processing by ClarkKent::ReportsController#new as HTML
24841
+ Parameters: {"current_user_id"=>"1"}
24842
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
24843
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
24844
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_edit.html.erb (39.2ms)
24845
+ Completed 200 OK in 46ms (Views: 45.4ms | ActiveRecord: 0.3ms)
24846
+ ---------------------------------------------------------
24847
+ ClarkKent::ReportsControllerTest: test_should_show_report
24848
+ ---------------------------------------------------------
24849
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
24850
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
24851
+ Processing by ClarkKent::ReportsController#show as HTML
24852
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
24853
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = 1 ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
24854
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" IN (1) ORDER BY clark_kent_report_columns.column_order
24855
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
24856
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
24857
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
24858
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.7ms)
24859
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
24860
+ User Load (0.1ms) SELECT "users".* FROM "users"
24861
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (1.3ms)
24862
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.6ms)
24863
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (0.4ms)
24864
+ Completed 200 OK in 23ms (Views: 18.9ms | ActiveRecord: 0.9ms)
24865
+ -----------------------------------------------------------------
24866
+ ClarkKent::ReportsControllerTest: test_should_show_report_results
24867
+ -----------------------------------------------------------------
24868
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
24869
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
24870
+ Processing by ClarkKent::ReportsController#show as HTML
24871
+ Parameters: {"current_user_id"=>"1", "run_report"=>true, "created_at_until"=>"2015-10-05", "created_at_from"=>"2015-10-04", "id"=>"1"}
24872
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = 1 ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
24873
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" IN (1) ORDER BY clark_kent_report_columns.column_order
24874
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
24875
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
24876
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
24877
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
24878
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
24879
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.2ms)
24880
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
24881
+ User Load (0.2ms) SELECT "users".* FROM "users"
24882
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (1.6ms)
24883
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.2ms)
24884
+  (0.2ms) SELECT COUNT(*) FROM "orders" WHERE (orders.user_id > 0)
24885
+  (0.2ms) SELECT COUNT(count_column) FROM (SELECT "orders"."id" AS count_column FROM "orders" WHERE (orders.user_id > 0) LIMIT 10 OFFSET 0) subquery_for_count
24886
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (4.5ms)
24887
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
24888
+ Order Load (0.1ms) SELECT DISTINCT orders.id, orders.user_id, orders.amount, orders.description, orders.created_at, orders.updated_at,
24889
+ (SELECT u.name
24890
+ FROM users u
24891
+ WHERE u.id = orders.user_id)
24892
+ as user_name FROM "orders" WHERE (orders.user_id > 0) LIMIT 10 OFFSET 0
24893
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
24894
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
24895
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
24896
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
24897
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_download_link.html.erb (1.2ms)
24898
+ Completed 200 OK in 29ms (Views: 23.5ms | ActiveRecord: 2.0ms)
24899
+ --------------------------------------------------------------------
24900
+ ClarkKent::ReportsControllerTest: test_should_show_report_run_errors
24901
+ --------------------------------------------------------------------
24902
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
24903
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
24904
+ Processing by ClarkKent::ReportsController#show as HTML
24905
+ Parameters: {"current_user_id"=>"1", "run_report"=>true, "id"=>"1"}
24906
+ ClarkKent::Report Load (0.3ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = 1 ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
24907
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" IN (1) ORDER BY clark_kent_report_columns.column_order
24908
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
24909
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
24910
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
24911
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
24912
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
24913
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.2ms)
24914
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
24915
+ User Load (0.1ms) SELECT "users".* FROM "users"
24916
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (1.0ms)
24917
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.1ms)
24918
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (0.0ms)
24919
+ Completed 200 OK in 10ms (Views: 5.1ms | ActiveRecord: 1.0ms)
24920
+ -----------------------------------------------------------
24921
+ ClarkKent::ReportsControllerTest: test_should_update_report
24922
+ -----------------------------------------------------------
24923
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
24924
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
24925
+ Processing by ClarkKent::ReportsController#update as HTML
24926
+ Parameters: {"report"=>{"name"=>nil, "resource_type"=>"Order", "sharing_scope_id"=>nil, "sharing_scope_type"=>nil}, "current_user_id"=>"1", "id"=>"1"}
24927
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
24928
+  (0.0ms) begin transaction
24929
+  (0.0ms) commit transaction
24930
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (0.8ms)
24931
+ Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.2ms)
24932
+ -------------------------
24933
+ ClarkKentTest: test_truth
24934
+ -------------------------
24935
+ -------------------------------------------------------------------
24936
+ ClarkKent::ReportableTest: test_it_adds_required_filters_if_present
24937
+ -------------------------------------------------------------------
24938
+  (0.1ms) begin transaction
24939
+ SQL (0.3ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-10-05 16:28:35.644304"], ["name", "test one"], ["resource_type", "Order"], ["updated_at", "2015-10-05 16:28:35.644304"]]
24940
+  (0.7ms) commit transaction
24941
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 4]]
24942
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 4], ["filterable_type", "ClarkKent::Report"]]
24943
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 4]]
24944
+ ---------------------------------------------------------------------
24945
+ ClarkKent::ReportableTest: test_it_works_without_any_required_filters
24946
+ ---------------------------------------------------------------------
24947
+  (0.1ms) begin transaction
24948
+ SQL (0.3ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-10-05 16:28:35.649137"], ["name", "test one"], ["resource_type", "TestReportable"], ["updated_at", "2015-10-05 16:28:35.649137"]]
24949
+  (0.8ms) commit transaction
24950
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 5]]
24951
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 5], ["filterable_type", "ClarkKent::Report"]]
24952
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 5]]
24953
+ ------------------------------------------------------------------------------------------------
24954
+ ClarkKent::ReportTest: test_can't_save_without_a_sharing_scope_id_if_the_sharing_scope_is_custom
24955
+ ------------------------------------------------------------------------------------------------
24956
+  (0.1ms) begin transaction
24957
+  (0.1ms) rollback transaction
24958
+ ---------------------------------------------------
24959
+ ClarkKent::ReportEmailTest: test_sends_report_to_s3
24960
+ ---------------------------------------------------
24961
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
24962
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
24963
+ SQL (0.9ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
24964
+  (0.1ms) begin transaction
24965
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
24966
+  (0.6ms) commit transaction
24967
+  (0.0ms) begin transaction
24968
+ SQL (0.4ms) INSERT INTO "clark_kent_report_filters" ("created_at", "duration", "filter_name", "filterable_id", "filterable_type", "kind_of_day", "offset", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-10-05 16:28:35.676509"], ["duration", "week"], ["filter_name", "created_at"], ["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"], ["kind_of_day", "Monday"], ["offset", "this_week"], ["type", "ClarkKent::ReportDateFilter"], ["updated_at", "2015-10-05 16:28:35.676509"]]
24969
+  (1.1ms) commit transaction
24970
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
24971
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
24972
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
24973
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
24974
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
24975
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
24976
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
24977
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
24978
+ -----------------------------------------------------------------------------------------
24979
+ ClarkKent::ReportEmailTest: test_throws_an_error_if_required_date_filters_are_not_present
24980
+ -----------------------------------------------------------------------------------------
24981
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
24982
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
24983
+ SQL (0.9ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
24984
+  (0.1ms) begin transaction
24985
+ SQL (0.2ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
24986
+  (0.6ms) commit transaction
24987
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
24988
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
24989
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
24990
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
24991
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 2]]
24992
+  (1.8ms) CREATE TABLE "clark_kent_report_columns" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "column_name" varchar(255), "column_order" integer, "report_sort" varchar(255), "summary_method" varchar(255)) 
24993
+  (0.3ms) select sqlite_version(*)
24994
+  (0.9ms) CREATE INDEX "index_clark_kent_report_columns_on_report_id" ON "clark_kent_report_columns" ("report_id")
24995
+  (0.8ms) CREATE TABLE "clark_kent_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "when_to_send" varchar(255), "name" varchar(255))
24996
+  (1.3ms) CREATE TABLE "clark_kent_report_filters" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "filterable_id" integer, "filterable_type" varchar(255) DEFAULT 'ClarkKent::Report', "string" varchar(255) DEFAULT 'ClarkKent::Report', "filter_name" varchar(255), "filter_value" varchar(255), "type" varchar(255), "duration" varchar(255), "kind_of_day" varchar(255), "offset" varchar(255), "created_at" datetime, "updated_at" datetime) 
24997
+  (0.8ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_id" ON "clark_kent_report_filters" ("filterable_id")
24998
+  (0.1ms)  SELECT sql
24999
+ FROM sqlite_master
25000
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
25001
+ UNION ALL
25002
+ SELECT sql
25003
+ FROM sqlite_temp_master
25004
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
25005
+ 
25006
+  (0.8ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_type" ON "clark_kent_report_filters" ("filterable_type")
25007
+  (0.9ms) CREATE TABLE "clark_kent_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "resource_type" varchar(255), "sharing_scope_type" varchar(255), "sharing_scope_id" integer, "created_at" datetime, "updated_at" datetime) 
25008
+  (0.9ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_id" ON "clark_kent_reports" ("sharing_scope_id")
25009
+  (0.1ms)  SELECT sql
25010
+ FROM sqlite_master
25011
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
25012
+ UNION ALL
25013
+ SELECT sql
25014
+ FROM sqlite_temp_master
25015
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
25016
+ 
25017
+  (0.7ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_type" ON "clark_kent_reports" ("sharing_scope_type")
25018
+  (0.8ms) CREATE TABLE "clark_kent_user_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "report_email_id" integer) 
25019
+  (0.8ms) CREATE TABLE "departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255))
25020
+  (0.8ms) CREATE TABLE "orders" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "amount" integer, "description" varchar(255), "created_at" datetime, "updated_at" datetime) 
25021
+  (0.8ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "email" varchar(255), "age" integer, "department_id" integer)
25022
+  (1.0ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
25023
+  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
25024
+  (0.1ms) SELECT version FROM "schema_migrations"
25025
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150313144015')
25026
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170042')
25027
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170112')
25028
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140114010048')
25029
+  (1.1ms) INSERT INTO "schema_migrations" (version) VALUES ('20140129051754')
25030
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150304233739')
25031
+  (0.1ms) begin transaction
25032
+ SQL (0.4ms) INSERT INTO "clark_kent_reports" ("created_at", "resource_type", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-05 16:29:52.445897"], ["resource_type", "Order"], ["updated_at", "2015-10-05 16:29:52.445897"]]
25033
+  (1.1ms) commit transaction
25034
+  (0.0ms) begin transaction
25035
+ SQL (0.3ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "user_name"], ["column_order", 1], ["report_id", 1]]
25036
+  (1.0ms) commit transaction
25037
+  (0.1ms) begin transaction
25038
+ SQL (0.3ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "id"], ["column_order", 2], ["report_id", 1]]
25039
+  (0.9ms) commit transaction
25040
+  (0.1ms) begin transaction
25041
+ SQL (0.2ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "amount"], ["column_order", 3], ["report_id", 1]]
25042
+  (0.7ms) commit transaction
25043
+  (0.0ms) begin transaction
25044
+ SQL (0.2ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "description"], ["column_order", 4], ["report_id", 1]]
25045
+  (0.6ms) commit transaction
25046
+  (0.0ms) begin transaction
25047
+ SQL (0.3ms) INSERT INTO "departments" ("name") VALUES (?) [["name", "silly walks"]]
25048
+  (0.7ms) commit transaction
25049
+  (0.0ms) begin transaction
25050
+ SQL (0.3ms) INSERT INTO "users" ("department_id", "email", "name") VALUES (?, ?, ?) [["department_id", 1], ["email", "taproot@gmail.com"], ["name", "Michael Hedges"]]
25051
+  (1.0ms) commit transaction
25052
+  (0.0ms) begin transaction
25053
+ SQL (0.3ms) INSERT INTO "orders" ("amount", "created_at", "description", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["amount", 1], ["created_at", "2015-10-05 16:29:52.506109"], ["description", "Guitar strings"], ["updated_at", "2015-10-05 16:29:52.506109"], ["user_id", 1]]
25054
+  (1.0ms) commit transaction
25055
+ ------------------------------------------------------------------------------------------------
25056
+ ClarkKent::ReportTest: test_can't_save_without_a_sharing_scope_id_if_the_sharing_scope_is_custom
25057
+ ------------------------------------------------------------------------------------------------
25058
+  (0.1ms) begin transaction
25059
+  (0.1ms) rollback transaction
25060
+ -----------------------------------------------------------
25061
+ ClarkKent::ReportsControllerTest: test_should_create_report
25062
+ -----------------------------------------------------------
25063
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25064
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
25065
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
25066
+ Processing by ClarkKent::ReportsController#create as HTML
25067
+ Parameters: {"report"=>{"name"=>"delete me", "resource_type"=>"Order", "sharing_scope_id"=>nil, "sharing_scope_type"=>nil}, "current_user_id"=>"1"}
25068
+  (0.1ms) begin transaction
25069
+ SQL (0.3ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-10-05 16:29:52.571191"], ["name", "delete me"], ["resource_type", "Order"], ["updated_at", "2015-10-05 16:29:52.571191"]]
25070
+  (0.8ms) commit transaction
25071
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (3.2ms)
25072
+ ClarkKent::ReportFilter Load (0.2ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 2], ["filterable_type", "ClarkKent::Report"]]
25073
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_index.html.erb (4.5ms)
25074
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 2]]
25075
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_index.html.erb (1.8ms)
25076
+ ClarkKent::ReportEmail Load (0.1ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 2]]
25077
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_index.html.erb (8.5ms)
25078
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/edit.html.erb within layouts/application (31.2ms)
25079
+ Completed 200 OK in 188ms (Views: 183.8ms | ActiveRecord: 1.9ms)
25080
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
25081
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."name" = 'delete me' LIMIT 1
25082
+  (0.0ms) begin transaction
25083
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 2], ["filterable_type", "ClarkKent::Report"]]
25084
+ ClarkKent::ReportColumn Load (0.0ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 2]]
25085
+ ClarkKent::ReportEmail Load (0.0ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 2]]
25086
+ SQL (0.2ms) DELETE FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? [["id", 2]]
25087
+  (1.4ms) commit transaction
25088
+ ------------------------------------------------------------
25089
+ ClarkKent::ReportsControllerTest: test_should_destroy_report
25090
+ ------------------------------------------------------------
25091
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25092
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
25093
+  (0.0ms) begin transaction
25094
+ SQL (0.3ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-10-05 16:29:52.767323"], ["name", "delete me"], ["resource_type", "Order"], ["updated_at", "2015-10-05 16:29:52.767323"]]
25095
+  (0.7ms) commit transaction
25096
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
25097
+ Processing by ClarkKent::ReportsController#destroy as HTML
25098
+ Parameters: {"current_user_id"=>"1", "id"=>"3"}
25099
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 3]]
25100
+  (0.0ms) begin transaction
25101
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 3], ["filterable_type", "ClarkKent::Report"]]
25102
+ ClarkKent::ReportColumn Load (0.0ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 3]]
25103
+ ClarkKent::ReportEmail Load (0.0ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 3]]
25104
+ SQL (0.2ms) DELETE FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? [["id", 3]]
25105
+  (0.7ms) commit transaction
25106
+ Redirected to http://test.host/reports/reports
25107
+ Completed 302 Found in 4ms (ActiveRecord: 1.2ms)
25108
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
25109
+ ------------------------------------------------------
25110
+ ClarkKent::ReportsControllerTest: test_should_get_edit
25111
+ ------------------------------------------------------
25112
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25113
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
25114
+ Processing by ClarkKent::ReportsController#edit as HTML
25115
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
25116
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
25117
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (0.7ms)
25118
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
25119
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_index.html.erb (1.1ms)
25120
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
25121
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.7ms)
25122
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (3.1ms)
25123
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.3ms)
25124
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.4ms)
25125
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.3ms)
25126
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.4ms)
25127
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.3ms)
25128
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.4ms)
25129
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_index.html.erb (7.6ms)
25130
+ ClarkKent::ReportEmail Load (0.1ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 1]]
25131
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_index.html.erb (0.9ms)
25132
+ Completed 200 OK in 14ms (Views: 12.5ms | ActiveRecord: 0.3ms)
25133
+ -------------------------------------------------------
25134
+ ClarkKent::ReportsControllerTest: test_should_get_index
25135
+ -------------------------------------------------------
25136
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25137
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
25138
+ Processing by ClarkKent::ReportsController#index as HTML
25139
+ Parameters: {"current_user_id"=>"1"}
25140
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
25141
+ ClarkKent::Report Exists (0.2ms) SELECT 1 AS one FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" = ? AND "clark_kent_reports"."sharing_scope_type" = ? LIMIT 1 [["sharing_scope_id", 1], ["sharing_scope_type", "User"]]
25142
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
25143
+ ClarkKent::Report Exists (0.1ms) SELECT 1 AS one FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" = ? AND "clark_kent_reports"."sharing_scope_type" = ? LIMIT 1 [["sharing_scope_id", 1], ["sharing_scope_type", "Department"]]
25144
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" IS NULL
25145
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" IS NULL
25146
+ Completed 200 OK in 17ms (Views: 16.0ms | ActiveRecord: 0.7ms)
25147
+ -----------------------------------------------------
25148
+ ClarkKent::ReportsControllerTest: test_should_get_new
25149
+ -----------------------------------------------------
25150
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25151
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
25152
+ Processing by ClarkKent::ReportsController#new as HTML
25153
+ Parameters: {"current_user_id"=>"1"}
25154
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
25155
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
25156
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_edit.html.erb (33.9ms)
25157
+ Completed 200 OK in 41ms (Views: 40.0ms | ActiveRecord: 0.2ms)
25158
+ ---------------------------------------------------------
25159
+ ClarkKent::ReportsControllerTest: test_should_show_report
25160
+ ---------------------------------------------------------
25161
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25162
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
25163
+ Processing by ClarkKent::ReportsController#show as HTML
25164
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
25165
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = 1 ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25166
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" IN (1) ORDER BY clark_kent_report_columns.column_order
25167
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
25168
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
25169
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
25170
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.7ms)
25171
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
25172
+ User Load (0.1ms) SELECT "users".* FROM "users"
25173
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (1.4ms)
25174
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.5ms)
25175
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (0.4ms)
25176
+ Completed 200 OK in 24ms (Views: 18.0ms | ActiveRecord: 1.0ms)
25177
+ -----------------------------------------------------------------
25178
+ ClarkKent::ReportsControllerTest: test_should_show_report_results
25179
+ -----------------------------------------------------------------
25180
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25181
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
25182
+ Processing by ClarkKent::ReportsController#show as HTML
25183
+ Parameters: {"current_user_id"=>"1", "run_report"=>true, "created_at_until"=>"2015-10-05", "created_at_from"=>"2015-10-04", "id"=>"1"}
25184
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = 1 ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25185
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" IN (1) ORDER BY clark_kent_report_columns.column_order
25186
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
25187
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
25188
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
25189
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
25190
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
25191
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.2ms)
25192
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
25193
+ User Load (0.1ms) SELECT "users".* FROM "users"
25194
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (1.4ms)
25195
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.1ms)
25196
+  (0.2ms) SELECT COUNT(*) FROM "orders" WHERE (orders.user_id > 0)
25197
+  (0.2ms) SELECT COUNT(count_column) FROM (SELECT "orders"."id" AS count_column FROM "orders" WHERE (orders.user_id > 0) LIMIT 10 OFFSET 0) subquery_for_count
25198
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (4.7ms)
25199
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
25200
+ Order Load (0.1ms) SELECT DISTINCT orders.id, orders.user_id, orders.amount, orders.description, orders.created_at, orders.updated_at,
25201
+ (SELECT u.name
25202
+ FROM users u
25203
+ WHERE u.id = orders.user_id)
25204
+ as user_name FROM "orders" WHERE (orders.user_id > 0) LIMIT 10 OFFSET 0
25205
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
25206
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
25207
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
25208
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
25209
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_download_link.html.erb (0.7ms)
25210
+ Completed 200 OK in 25ms (Views: 19.7ms | ActiveRecord: 1.9ms)
25211
+ --------------------------------------------------------------------
25212
+ ClarkKent::ReportsControllerTest: test_should_show_report_run_errors
25213
+ --------------------------------------------------------------------
25214
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25215
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
25216
+ Processing by ClarkKent::ReportsController#show as HTML
25217
+ Parameters: {"current_user_id"=>"1", "run_report"=>true, "id"=>"1"}
25218
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = 1 ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25219
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" IN (1) ORDER BY clark_kent_report_columns.column_order
25220
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
25221
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
25222
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
25223
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
25224
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
25225
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.2ms)
25226
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
25227
+ User Load (0.1ms) SELECT "users".* FROM "users"
25228
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (1.0ms)
25229
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.1ms)
25230
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (0.0ms)
25231
+ Completed 200 OK in 9ms (Views: 5.2ms | ActiveRecord: 0.8ms)
25232
+ -----------------------------------------------------------
25233
+ ClarkKent::ReportsControllerTest: test_should_update_report
25234
+ -----------------------------------------------------------
25235
+ ClarkKent::Report Load (0.3ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25236
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
25237
+ Processing by ClarkKent::ReportsController#update as HTML
25238
+ Parameters: {"report"=>{"name"=>nil, "resource_type"=>"Order", "sharing_scope_id"=>nil, "sharing_scope_type"=>nil}, "current_user_id"=>"1", "id"=>"1"}
25239
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
25240
+  (0.1ms) begin transaction
25241
+  (0.0ms) commit transaction
25242
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (0.9ms)
25243
+ Completed 200 OK in 3ms (Views: 1.3ms | ActiveRecord: 0.2ms)
25244
+ -------------------------------------------------------------------
25245
+ ClarkKent::ReportableTest: test_it_adds_required_filters_if_present
25246
+ -------------------------------------------------------------------
25247
+  (0.1ms) begin transaction
25248
+ SQL (0.3ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-10-05 16:29:52.931383"], ["name", "test one"], ["resource_type", "Order"], ["updated_at", "2015-10-05 16:29:52.931383"]]
25249
+  (1.4ms) commit transaction
25250
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 4]]
25251
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 4], ["filterable_type", "ClarkKent::Report"]]
25252
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 4]]
25253
+ ---------------------------------------------------------------------
25254
+ ClarkKent::ReportableTest: test_it_works_without_any_required_filters
25255
+ ---------------------------------------------------------------------
25256
+  (0.1ms) begin transaction
25257
+ SQL (0.3ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-10-05 16:29:52.937263"], ["name", "test one"], ["resource_type", "TestReportable"], ["updated_at", "2015-10-05 16:29:52.937263"]]
25258
+  (0.7ms) commit transaction
25259
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 5]]
25260
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 5], ["filterable_type", "ClarkKent::Report"]]
25261
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 5]]
25262
+ -------------------------
25263
+ ClarkKentTest: test_truth
25264
+ -------------------------
25265
+ ---------------------------------------------------
25266
+ ClarkKent::ReportEmailTest: test_sends_report_to_s3
25267
+ ---------------------------------------------------
25268
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
25269
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25270
+ SQL (0.9ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
25271
+  (0.1ms) begin transaction
25272
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
25273
+  (0.7ms) commit transaction
25274
+  (0.0ms) begin transaction
25275
+ SQL (0.4ms) INSERT INTO "clark_kent_report_filters" ("created_at", "duration", "filter_name", "filterable_id", "filterable_type", "kind_of_day", "offset", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-10-05 16:29:52.964122"], ["duration", "week"], ["filter_name", "created_at"], ["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"], ["kind_of_day", "Monday"], ["offset", "this_week"], ["type", "ClarkKent::ReportDateFilter"], ["updated_at", "2015-10-05 16:29:52.964122"]]
25276
+  (0.8ms) commit transaction
25277
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
25278
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
25279
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
25280
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
25281
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
25282
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
25283
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
25284
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
25285
+ -----------------------------------------------------------------------------------------
25286
+ ClarkKent::ReportEmailTest: test_throws_an_error_if_required_date_filters_are_not_present
25287
+ -----------------------------------------------------------------------------------------
25288
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
25289
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25290
+ SQL (1.2ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
25291
+  (0.2ms) begin transaction
25292
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
25293
+  (0.8ms) commit transaction
25294
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
25295
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
25296
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
25297
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
25298
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 2]]
25299
+  (1.1ms) CREATE TABLE "clark_kent_report_columns" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "column_name" varchar, "column_order" integer, "report_sort" varchar, "summary_method" varchar) 
25300
+  (0.1ms) select sqlite_version(*)
25301
+  (1.2ms) CREATE INDEX "index_clark_kent_report_columns_on_report_id" ON "clark_kent_report_columns" ("report_id")
25302
+  (1.2ms) CREATE TABLE "clark_kent_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "when_to_send" varchar, "name" varchar)
25303
+  (1.0ms) CREATE TABLE "clark_kent_report_filters" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "filterable_id" integer, "filterable_type" varchar DEFAULT 'ClarkKent::Report', "string" varchar DEFAULT 'ClarkKent::Report', "filter_name" varchar, "filter_value" varchar, "type" varchar, "duration" varchar, "kind_of_day" varchar, "offset" varchar, "created_at" datetime, "updated_at" datetime) 
25304
+  (0.9ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_id" ON "clark_kent_report_filters" ("filterable_id")
25305
+  (0.1ms)  SELECT sql
25306
+ FROM sqlite_master
25307
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
25308
+ UNION ALL
25309
+ SELECT sql
25310
+ FROM sqlite_temp_master
25311
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
25312
+ 
25313
+  (0.9ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_type" ON "clark_kent_report_filters" ("filterable_type")
25314
+  (1.1ms) CREATE TABLE "clark_kent_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "resource_type" varchar, "sharing_scope_type" varchar, "sharing_scope_id" integer, "created_at" datetime, "updated_at" datetime) 
25315
+  (1.0ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_id" ON "clark_kent_reports" ("sharing_scope_id")
25316
+  (0.1ms)  SELECT sql
25317
+ FROM sqlite_master
25318
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
25319
+ UNION ALL
25320
+ SELECT sql
25321
+ FROM sqlite_temp_master
25322
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
25323
+ 
25324
+  (0.9ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_type" ON "clark_kent_reports" ("sharing_scope_type")
25325
+  (0.9ms) CREATE TABLE "clark_kent_user_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "report_email_id" integer) 
25326
+  (0.8ms) CREATE TABLE "departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar)
25327
+  (0.9ms) CREATE TABLE "orders" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "amount" integer, "description" varchar, "created_at" datetime, "updated_at" datetime) 
25328
+  (0.9ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "email" varchar, "age" integer, "department_id" integer)
25329
+  (0.9ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
25330
+  (1.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
25331
+  (0.1ms) SELECT version FROM "schema_migrations"
25332
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150313144015')
25333
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170042')
25334
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170112')
25335
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140114010048')
25336
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140129051754')
25337
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150304233739')
25338
+  (0.1ms) begin transaction
25339
+ SQL (0.5ms) INSERT INTO "clark_kent_reports" ("resource_type", "created_at", "updated_at") VALUES (?, ?, ?) [["resource_type", "Order"], ["created_at", "2015-10-05 16:38:49.454713"], ["updated_at", "2015-10-05 16:38:49.454713"]]
25340
+  (0.8ms) commit transaction
25341
+  (0.0ms) begin transaction
25342
+ SQL (0.4ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "user_name"], ["column_order", 1], ["report_id", 1]]
25343
+  (0.8ms) commit transaction
25344
+  (0.1ms) begin transaction
25345
+ SQL (0.2ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "id"], ["column_order", 2], ["report_id", 1]]
25346
+  (0.6ms) commit transaction
25347
+  (0.0ms) begin transaction
25348
+ SQL (0.2ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "amount"], ["column_order", 3], ["report_id", 1]]
25349
+  (0.7ms) commit transaction
25350
+  (0.0ms) begin transaction
25351
+ SQL (0.2ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "description"], ["column_order", 4], ["report_id", 1]]
25352
+  (0.7ms) commit transaction
25353
+  (0.0ms) begin transaction
25354
+ SQL (0.3ms) INSERT INTO "departments" ("name") VALUES (?) [["name", "silly walks"]]
25355
+  (0.7ms) commit transaction
25356
+  (0.1ms) begin transaction
25357
+ SQL (0.3ms) INSERT INTO "users" ("name", "email", "department_id") VALUES (?, ?, ?) [["name", "Michael Hedges"], ["email", "taproot@gmail.com"], ["department_id", 1]]
25358
+  (0.7ms) commit transaction
25359
+  (0.0ms) begin transaction
25360
+ SQL (0.3ms) INSERT INTO "orders" ("user_id", "description", "amount", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["user_id", 1], ["description", "Guitar strings"], ["amount", 1], ["created_at", "2015-10-05 16:38:49.501328"], ["updated_at", "2015-10-05 16:38:49.501328"]]
25361
+  (0.7ms) commit transaction
25362
+ -------------------------
25363
+ ClarkKentTest: test_truth
25364
+ -------------------------
25365
+ -------------------------------------------------------------------
25366
+ ClarkKent::ReportableTest: test_it_adds_required_filters_if_present
25367
+ -------------------------------------------------------------------
25368
+  (0.1ms) begin transaction
25369
+ SQL (0.3ms) INSERT INTO "clark_kent_reports" ("name", "resource_type", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "test one"], ["resource_type", "Order"], ["created_at", "2015-10-05 16:38:49.562955"], ["updated_at", "2015-10-05 16:38:49.562955"]]
25370
+  (0.8ms) commit transaction
25371
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 2]]
25372
+ ClarkKent::ReportFilter Load (0.2ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 2], ["filterable_type", "ClarkKent::Report"]]
25373
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 2]]
25374
+ ---------------------------------------------------------------------
25375
+ ClarkKent::ReportableTest: test_it_works_without_any_required_filters
25376
+ ---------------------------------------------------------------------
25377
+  (0.1ms) begin transaction
25378
+ SQL (0.3ms) INSERT INTO "clark_kent_reports" ("name", "resource_type", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "test one"], ["resource_type", "TestReportable"], ["created_at", "2015-10-05 16:38:49.574388"], ["updated_at", "2015-10-05 16:38:49.574388"]]
25379
+  (0.8ms) commit transaction
25380
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 3]]
25381
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 3], ["filterable_type", "ClarkKent::Report"]]
25382
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 3]]
25383
+ ------------------------------------------------------------------------------------------------
25384
+ ClarkKent::ReportTest: test_can't_save_without_a_sharing_scope_id_if_the_sharing_scope_is_custom
25385
+ ------------------------------------------------------------------------------------------------
25386
+  (0.1ms) begin transaction
25387
+  (0.1ms) rollback transaction
25388
+ ---------------------------------------------------
25389
+ ClarkKent::ReportEmailTest: test_sends_report_to_s3
25390
+ ---------------------------------------------------
25391
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1 [["email", "taproot@gmail.com"]]
25392
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25393
+ SQL (1.0ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = ? [["id", 1]]
25394
+  (0.1ms) begin transaction
25395
+ SQL (0.4ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
25396
+  (0.6ms) commit transaction
25397
+  (0.0ms) begin transaction
25398
+ SQL (0.6ms) INSERT INTO "clark_kent_report_filters" ("type", "filter_name", "duration", "kind_of_day", "offset", "filterable_id", "filterable_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["type", "ClarkKent::ReportDateFilter"], ["filter_name", "created_at"], ["duration", "week"], ["kind_of_day", "Monday"], ["offset", "this_week"], ["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"], ["created_at", "2015-10-05 16:38:49.621261"], ["updated_at", "2015-10-05 16:38:49.621261"]]
25399
+  (1.1ms) commit transaction
25400
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
25401
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
25402
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
25403
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
25404
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
25405
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
25406
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
25407
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
25408
+ -----------------------------------------------------------------------------------------
25409
+ ClarkKent::ReportEmailTest: test_throws_an_error_if_required_date_filters_are_not_present
25410
+ -----------------------------------------------------------------------------------------
25411
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1 [["email", "taproot@gmail.com"]]
25412
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25413
+ SQL (0.9ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = ? [["id", 1]]
25414
+  (0.1ms) begin transaction
25415
+ SQL (0.2ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
25416
+  (0.7ms) commit transaction
25417
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
25418
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
25419
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
25420
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
25421
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 2]]
25422
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 2]]
25423
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 2], ["filterable_type", "ClarkKent::Report"]]
25424
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 2]]
25425
+ -----------------------------------------------------------
25426
+ ClarkKent::ReportsControllerTest: test_should_create_report
25427
+ -----------------------------------------------------------
25428
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25429
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
25430
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
25431
+ ------------------------------------------------------------
25432
+ ClarkKent::ReportsControllerTest: test_should_destroy_report
25433
+ ------------------------------------------------------------
25434
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25435
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
25436
+  (0.1ms) begin transaction
25437
+ SQL (0.3ms) INSERT INTO "clark_kent_reports" ("name", "resource_type", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "delete me"], ["resource_type", "Order"], ["created_at", "2015-10-05 16:38:49.720486"], ["updated_at", "2015-10-05 16:38:49.720486"]]
25438
+  (0.8ms) commit transaction
25439
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
25440
+ ------------------------------------------------------
25441
+ ClarkKent::ReportsControllerTest: test_should_get_edit
25442
+ ------------------------------------------------------
25443
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25444
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
25445
+ Processing by ClarkKent::ReportsController#edit as HTML
25446
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
25447
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/edit.html.erb within layouts/application (5.9ms)
25448
+ Completed 500 Internal Server Error in 20ms
25449
+ -------------------------------------------------------
25450
+ ClarkKent::ReportsControllerTest: test_should_get_index
25451
+ -------------------------------------------------------
25452
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25453
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
25454
+ Processing by ClarkKent::ReportsController#index as HTML
25455
+ Parameters: {"current_user_id"=>"1"}
25456
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
25457
+ ClarkKent::Report Exists (0.2ms) SELECT 1 AS one FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" = ? AND "clark_kent_reports"."sharing_scope_type" = ? LIMIT 1 [["sharing_scope_id", 1], ["sharing_scope_type", "User"]]
25458
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
25459
+ ClarkKent::Report Exists (0.1ms) SELECT 1 AS one FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" = ? AND "clark_kent_reports"."sharing_scope_type" = ? LIMIT 1 [["sharing_scope_id", 1], ["sharing_scope_type", "Department"]]
25460
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" = ? AND "clark_kent_reports"."sharing_scope_type" = ? [["sharing_scope_id", 1], ["sharing_scope_type", "Department"]]
25461
+  (0.2ms) SELECT COUNT(*) FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" IS NULL
25462
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" IS NULL
25463
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/index.html.erb within layouts/application (28.2ms)
25464
+ Completed 200 OK in 166ms (Views: 165.1ms | ActiveRecord: 1.0ms)
25465
+ -----------------------------------------------------
25466
+ ClarkKent::ReportsControllerTest: test_should_get_new
25467
+ -----------------------------------------------------
25468
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25469
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
25470
+ Processing by ClarkKent::ReportsController#new as HTML
25471
+ Parameters: {"current_user_id"=>"1"}
25472
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_edit.html.erb (3.6ms)
25473
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/new.html.erb within layouts/application (10.3ms)
25474
+ Completed 500 Internal Server Error in 13ms
25475
+ ---------------------------------------------------------
25476
+ ClarkKent::ReportsControllerTest: test_should_show_report
25477
+ ---------------------------------------------------------
25478
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25479
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
25480
+ Processing by ClarkKent::ReportsController#show as HTML
25481
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
25482
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/show.html.erb within layouts/application (3.2ms)
25483
+ Completed 500 Internal Server Error in 6ms
25484
+ -----------------------------------------------------------------
25485
+ ClarkKent::ReportsControllerTest: test_should_show_report_results
25486
+ -----------------------------------------------------------------
25487
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25488
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
25489
+ Processing by ClarkKent::ReportsController#show as HTML
25490
+ Parameters: {"current_user_id"=>"1", "run_report"=>true, "created_at_until"=>"2015-10-05", "created_at_from"=>"2015-10-04", "id"=>"1"}
25491
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/show.html.erb within layouts/application (2.1ms)
25492
+ Completed 500 Internal Server Error in 3ms
25493
+ --------------------------------------------------------------------
25494
+ ClarkKent::ReportsControllerTest: test_should_show_report_run_errors
25495
+ --------------------------------------------------------------------
25496
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25497
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
25498
+ Processing by ClarkKent::ReportsController#show as HTML
25499
+ Parameters: {"current_user_id"=>"1", "run_report"=>true, "id"=>"1"}
25500
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/show.html.erb within layouts/application (2.3ms)
25501
+ Completed 500 Internal Server Error in 3ms
25502
+ -----------------------------------------------------------
25503
+ ClarkKent::ReportsControllerTest: test_should_update_report
25504
+ -----------------------------------------------------------
25505
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25506
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
25507
+  (1.5ms) CREATE TABLE "clark_kent_report_columns" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "column_name" varchar(255), "column_order" integer, "report_sort" varchar(255), "summary_method" varchar(255)) 
25508
+  (0.1ms) select sqlite_version(*)
25509
+  (1.1ms) CREATE INDEX "index_clark_kent_report_columns_on_report_id" ON "clark_kent_report_columns" ("report_id")
25510
+  (1.1ms) CREATE TABLE "clark_kent_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "when_to_send" varchar(255), "name" varchar(255))
25511
+  (0.9ms) CREATE TABLE "clark_kent_report_filters" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "filterable_id" integer, "filterable_type" varchar(255) DEFAULT 'ClarkKent::Report', "string" varchar(255) DEFAULT 'ClarkKent::Report', "filter_name" varchar(255), "filter_value" varchar(255), "type" varchar(255), "duration" varchar(255), "kind_of_day" varchar(255), "offset" varchar(255), "created_at" datetime, "updated_at" datetime) 
25512
+  (0.9ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_id" ON "clark_kent_report_filters" ("filterable_id")
25513
+  (0.1ms)  SELECT sql
25514
+ FROM sqlite_master
25515
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
25516
+ UNION ALL
25517
+ SELECT sql
25518
+ FROM sqlite_temp_master
25519
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
25520
+ 
25521
+  (0.9ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_type" ON "clark_kent_report_filters" ("filterable_type")
25522
+  (1.1ms) CREATE TABLE "clark_kent_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "resource_type" varchar(255), "sharing_scope_type" varchar(255), "sharing_scope_id" integer, "created_at" datetime, "updated_at" datetime) 
25523
+  (0.9ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_id" ON "clark_kent_reports" ("sharing_scope_id")
25524
+  (0.1ms)  SELECT sql
25525
+ FROM sqlite_master
25526
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
25527
+ UNION ALL
25528
+ SELECT sql
25529
+ FROM sqlite_temp_master
25530
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
25531
+ 
25532
+  (0.9ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_type" ON "clark_kent_reports" ("sharing_scope_type")
25533
+  (0.9ms) CREATE TABLE "clark_kent_user_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "report_email_id" integer) 
25534
+  (0.9ms) CREATE TABLE "departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255))
25535
+  (0.8ms) CREATE TABLE "orders" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "amount" integer, "description" varchar(255), "created_at" datetime, "updated_at" datetime) 
25536
+  (0.9ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "email" varchar(255), "age" integer, "department_id" integer)
25537
+  (1.0ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
25538
+  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
25539
+  (0.1ms) SELECT version FROM "schema_migrations"
25540
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150313144015')
25541
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170042')
25542
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170112')
25543
+  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20140114010048')
25544
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140129051754')
25545
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150304233739')
25546
+  (0.1ms) begin transaction
25547
+ SQL (0.3ms) INSERT INTO "clark_kent_reports" ("created_at", "resource_type", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-05 16:47:05.112969"], ["resource_type", "Order"], ["updated_at", "2015-10-05 16:47:05.112969"]]
25548
+  (0.6ms) commit transaction
25549
+  (0.0ms) begin transaction
25550
+ SQL (0.3ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "user_name"], ["column_order", 1], ["report_id", 1]]
25551
+  (1.0ms) commit transaction
25552
+  (0.1ms) begin transaction
25553
+ SQL (0.2ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "id"], ["column_order", 2], ["report_id", 1]]
25554
+  (0.9ms) commit transaction
25555
+  (0.1ms) begin transaction
25556
+ SQL (0.2ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "amount"], ["column_order", 3], ["report_id", 1]]
25557
+  (0.6ms) commit transaction
25558
+  (0.0ms) begin transaction
25559
+ SQL (0.2ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "description"], ["column_order", 4], ["report_id", 1]]
25560
+  (0.7ms) commit transaction
25561
+  (0.0ms) begin transaction
25562
+ SQL (0.3ms) INSERT INTO "departments" ("name") VALUES (?) [["name", "silly walks"]]
25563
+  (0.7ms) commit transaction
25564
+  (0.1ms) begin transaction
25565
+ SQL (0.5ms) INSERT INTO "users" ("department_id", "email", "name") VALUES (?, ?, ?) [["department_id", 1], ["email", "taproot@gmail.com"], ["name", "Michael Hedges"]]
25566
+  (0.7ms) commit transaction
25567
+  (0.1ms) begin transaction
25568
+ SQL (0.3ms) INSERT INTO "orders" ("amount", "created_at", "description", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["amount", 1], ["created_at", "2015-10-05 16:47:05.170158"], ["description", "Guitar strings"], ["updated_at", "2015-10-05 16:47:05.170158"], ["user_id", 1]]
25569
+  (0.9ms) commit transaction
25570
+ ---------------------------------------------------
25571
+ ClarkKent::ReportEmailTest: test_sends_report_to_s3
25572
+ ---------------------------------------------------
25573
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
25574
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25575
+ SQL (0.9ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
25576
+  (0.0ms) begin transaction
25577
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
25578
+  (0.8ms) commit transaction
25579
+  (0.0ms) begin transaction
25580
+ SQL (0.5ms) INSERT INTO "clark_kent_report_filters" ("created_at", "duration", "filter_name", "filterable_id", "filterable_type", "kind_of_day", "offset", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-10-05 16:47:05.239537"], ["duration", "week"], ["filter_name", "created_at"], ["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"], ["kind_of_day", "Monday"], ["offset", "this_week"], ["type", "ClarkKent::ReportDateFilter"], ["updated_at", "2015-10-05 16:47:05.239537"]]
25581
+  (0.8ms) commit transaction
25582
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
25583
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
25584
+ ClarkKent::ReportFilter Load (0.2ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
25585
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
25586
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
25587
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
25588
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
25589
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
25590
+ -----------------------------------------------------------------------------------------
25591
+ ClarkKent::ReportEmailTest: test_throws_an_error_if_required_date_filters_are_not_present
25592
+ -----------------------------------------------------------------------------------------
25593
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
25594
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25595
+ SQL (0.8ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
25596
+  (0.1ms) begin transaction
25597
+ SQL (0.2ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
25598
+  (0.6ms) commit transaction
25599
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
25600
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
25601
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
25602
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
25603
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 2]]
25604
+ -----------------------------------------------------------
25605
+ ClarkKent::ReportsControllerTest: test_should_create_report
25606
+ -----------------------------------------------------------
25607
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25608
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
25609
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
25610
+ Processing by ClarkKent::ReportsController#create as HTML
25611
+ Parameters: {"report"=>{"name"=>"delete me", "resource_type"=>"Order", "sharing_scope_id"=>"1", "sharing_scope_type"=>"Department"}, "current_user_id"=>"1"}
25612
+  (0.1ms) begin transaction
25613
+ SQL (0.6ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "sharing_scope_id", "sharing_scope_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-10-05 16:47:05.342815"], ["name", "delete me"], ["resource_type", "Order"], ["sharing_scope_id", 1], ["sharing_scope_type", "Department"], ["updated_at", "2015-10-05 16:47:05.342815"]]
25614
+  (0.8ms) commit transaction
25615
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
25616
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (2.9ms)
25617
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 2], ["filterable_type", "ClarkKent::Report"]]
25618
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_index.html.erb (2.9ms)
25619
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 2]]
25620
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_index.html.erb (2.0ms)
25621
+ ClarkKent::ReportEmail Load (0.2ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 2]]
25622
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_index.html.erb (1.8ms)
25623
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/edit.html.erb within layouts/application (22.8ms)
25624
+ Completed 200 OK in 158ms (Views: 153.3ms | ActiveRecord: 1.9ms)
25625
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
25626
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."name" = 'delete me' LIMIT 1
25627
+  (0.1ms) begin transaction
25628
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 2], ["filterable_type", "ClarkKent::Report"]]
25629
+ ClarkKent::ReportColumn Load (0.0ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 2]]
25630
+ ClarkKent::ReportEmail Load (0.0ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 2]]
25631
+ SQL (0.2ms) DELETE FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? [["id", 2]]
25632
+  (1.5ms) commit transaction
25633
+ ------------------------------------------------------------
25634
+ ClarkKent::ReportsControllerTest: test_should_destroy_report
25635
+ ------------------------------------------------------------
25636
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25637
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
25638
+  (0.0ms) begin transaction
25639
+ SQL (0.3ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-10-05 16:47:05.507706"], ["name", "delete me"], ["resource_type", "Order"], ["updated_at", "2015-10-05 16:47:05.507706"]]
25640
+  (0.9ms) commit transaction
25641
+  (0.2ms) SELECT COUNT(*) FROM "clark_kent_reports"
25642
+ Processing by ClarkKent::ReportsController#destroy as HTML
25643
+ Parameters: {"current_user_id"=>"1", "id"=>"3"}
25644
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 3]]
25645
+  (0.1ms) begin transaction
25646
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 3], ["filterable_type", "ClarkKent::Report"]]
25647
+ ClarkKent::ReportColumn Load (0.0ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 3]]
25648
+ ClarkKent::ReportEmail Load (0.0ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 3]]
25649
+ SQL (0.2ms) DELETE FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? [["id", 3]]
25650
+  (0.7ms) commit transaction
25651
+ Redirected to http://test.host/reports/reports
25652
+ Completed 302 Found in 5ms (ActiveRecord: 1.3ms)
25653
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
25654
+ ------------------------------------------------------
25655
+ ClarkKent::ReportsControllerTest: test_should_get_edit
25656
+ ------------------------------------------------------
25657
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25658
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
25659
+ Processing by ClarkKent::ReportsController#edit as HTML
25660
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
25661
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
25662
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
25663
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (1.8ms)
25664
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
25665
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_index.html.erb (1.2ms)
25666
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
25667
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.8ms)
25668
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (3.3ms)
25669
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.3ms)
25670
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.4ms)
25671
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.3ms)
25672
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.4ms)
25673
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.3ms)
25674
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.4ms)
25675
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_index.html.erb (8.5ms)
25676
+ ClarkKent::ReportEmail Load (0.2ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 1]]
25677
+ ClarkKent::ReportDateFilter Load (0.2ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."type" IN ('ClarkKent::ReportDateFilter') AND "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"]]
25678
+ User Load (0.2ms) SELECT "users".* FROM "users" INNER JOIN "clark_kent_user_report_emails" ON "users"."id" = "clark_kent_user_report_emails"."user_id" WHERE "clark_kent_user_report_emails"."report_email_id" = ? [["report_email_id", 1]]
25679
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show.html.erb (15.8ms)
25680
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show_wrapper.html.erb (19.0ms)
25681
+ ClarkKent::ReportDateFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."type" IN ('ClarkKent::ReportDateFilter') AND "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 2], ["filterable_type", "ClarkKent::ReportEmail"]]
25682
+ User Load (0.1ms) SELECT "users".* FROM "users" INNER JOIN "clark_kent_user_report_emails" ON "users"."id" = "clark_kent_user_report_emails"."user_id" WHERE "clark_kent_user_report_emails"."report_email_id" = ? [["report_email_id", 2]]
25683
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show.html.erb (2.1ms)
25684
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show_wrapper.html.erb (2.3ms)
25685
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_index.html.erb (26.1ms)
25686
+ Completed 200 OK in 41ms (Views: 39.1ms | ActiveRecord: 1.3ms)
25687
+ -------------------------------------------------------
25688
+ ClarkKent::ReportsControllerTest: test_should_get_index
25689
+ -------------------------------------------------------
25690
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25691
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
25692
+ Processing by ClarkKent::ReportsController#index as HTML
25693
+ Parameters: {"current_user_id"=>"1"}
25694
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
25695
+ ClarkKent::Report Exists (0.3ms) SELECT 1 AS one FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" = ? AND "clark_kent_reports"."sharing_scope_type" = ? LIMIT 1 [["sharing_scope_id", 1], ["sharing_scope_type", "User"]]
25696
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
25697
+ ClarkKent::Report Exists (0.1ms) SELECT 1 AS one FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" = ? AND "clark_kent_reports"."sharing_scope_type" = ? LIMIT 1 [["sharing_scope_id", 1], ["sharing_scope_type", "Department"]]
25698
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" = ? AND "clark_kent_reports"."sharing_scope_type" = ? [["sharing_scope_id", 1], ["sharing_scope_type", "Department"]]
25699
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" IS NULL
25700
+ Completed 200 OK in 14ms (Views: 13.0ms | ActiveRecord: 0.8ms)
25701
+ -----------------------------------------------------
25702
+ ClarkKent::ReportsControllerTest: test_should_get_new
25703
+ -----------------------------------------------------
25704
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25705
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
25706
+ Processing by ClarkKent::ReportsController#new as HTML
25707
+ Parameters: {"current_user_id"=>"1"}
25708
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
25709
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
25710
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_edit.html.erb (44.1ms)
25711
+ Completed 200 OK in 51ms (Views: 50.4ms | ActiveRecord: 0.2ms)
25712
+ ---------------------------------------------------------
25713
+ ClarkKent::ReportsControllerTest: test_should_show_report
25714
+ ---------------------------------------------------------
25715
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25716
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
25717
+ Processing by ClarkKent::ReportsController#show as HTML
25718
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
25719
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = 1 ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25720
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" IN (1) ORDER BY clark_kent_report_columns.column_order
25721
+  (0.2ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
25722
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
25723
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
25724
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.7ms)
25725
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
25726
+ User Load (0.1ms) SELECT "users".* FROM "users"
25727
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (1.6ms)
25728
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.5ms)
25729
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (0.5ms)
25730
+ Completed 200 OK in 24ms (Views: 19.4ms | ActiveRecord: 0.9ms)
25731
+ -----------------------------------------------------------------
25732
+ ClarkKent::ReportsControllerTest: test_should_show_report_results
25733
+ -----------------------------------------------------------------
25734
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25735
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
25736
+ Processing by ClarkKent::ReportsController#show as HTML
25737
+ Parameters: {"current_user_id"=>"1", "run_report"=>true, "created_at_until"=>"2015-10-05", "created_at_from"=>"2015-10-04", "id"=>"1"}
25738
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = 1 ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25739
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" IN (1) ORDER BY clark_kent_report_columns.column_order
25740
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
25741
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
25742
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
25743
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
25744
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
25745
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.2ms)
25746
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
25747
+ User Load (0.1ms) SELECT "users".* FROM "users"
25748
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (0.9ms)
25749
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.3ms)
25750
+  (0.1ms) SELECT COUNT(*) FROM "orders" WHERE (orders.user_id > 0)
25751
+  (0.2ms) SELECT COUNT(count_column) FROM (SELECT "orders"."id" AS count_column FROM "orders" WHERE (orders.user_id > 0) LIMIT 10 OFFSET 0) subquery_for_count
25752
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (4.2ms)
25753
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
25754
+ Order Load (0.2ms) SELECT DISTINCT orders.id, orders.user_id, orders.amount, orders.description, orders.created_at, orders.updated_at,
25755
+ (SELECT u.name
25756
+ FROM users u
25757
+ WHERE u.id = orders.user_id)
25758
+ as user_name FROM "orders" WHERE (orders.user_id > 0) LIMIT 10 OFFSET 0
25759
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
25760
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
25761
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
25762
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
25763
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_download_link.html.erb (0.8ms)
25764
+ Completed 200 OK in 26ms (Views: 20.4ms | ActiveRecord: 1.9ms)
25765
+ --------------------------------------------------------------------
25766
+ ClarkKent::ReportsControllerTest: test_should_show_report_run_errors
25767
+ --------------------------------------------------------------------
25768
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25769
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
25770
+ Processing by ClarkKent::ReportsController#show as HTML
25771
+ Parameters: {"current_user_id"=>"1", "run_report"=>true, "id"=>"1"}
25772
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = 1 ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25773
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" IN (1) ORDER BY clark_kent_report_columns.column_order
25774
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
25775
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
25776
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
25777
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
25778
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
25779
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.2ms)
25780
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
25781
+ User Load (0.1ms) SELECT "users".* FROM "users"
25782
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (1.0ms)
25783
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.1ms)
25784
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (0.0ms)
25785
+ Completed 200 OK in 9ms (Views: 5.0ms | ActiveRecord: 0.8ms)
25786
+ -----------------------------------------------------------
25787
+ ClarkKent::ReportsControllerTest: test_should_update_report
25788
+ -----------------------------------------------------------
25789
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25790
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
25791
+ Processing by ClarkKent::ReportsController#update as HTML
25792
+ Parameters: {"report"=>{"name"=>nil, "resource_type"=>"Order", "sharing_scope_id"=>"1", "sharing_scope_type"=>"Department"}, "current_user_id"=>"1", "id"=>"1"}
25793
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
25794
+  (0.0ms) begin transaction
25795
+  (0.0ms) commit transaction
25796
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
25797
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (1.4ms)
25798
+ Completed 200 OK in 3ms (Views: 1.6ms | ActiveRecord: 0.2ms)
25799
+ ------------------------------------------------------------------------------------------------
25800
+ ClarkKent::ReportTest: test_can't_save_without_a_sharing_scope_id_if_the_sharing_scope_is_custom
25801
+ ------------------------------------------------------------------------------------------------
25802
+  (0.1ms) begin transaction
25803
+  (0.1ms) rollback transaction
25804
+ -------------------------------------------------------------------
25805
+ ClarkKent::ReportableTest: test_it_adds_required_filters_if_present
25806
+ -------------------------------------------------------------------
25807
+  (0.0ms) begin transaction
25808
+ SQL (0.3ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-10-05 16:47:05.710626"], ["name", "test one"], ["resource_type", "Order"], ["updated_at", "2015-10-05 16:47:05.710626"]]
25809
+  (1.4ms) commit transaction
25810
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 4]]
25811
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 4], ["filterable_type", "ClarkKent::Report"]]
25812
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 4]]
25813
+ ---------------------------------------------------------------------
25814
+ ClarkKent::ReportableTest: test_it_works_without_any_required_filters
25815
+ ---------------------------------------------------------------------
25816
+  (0.1ms) begin transaction
25817
+ SQL (0.3ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-10-05 16:47:05.716285"], ["name", "test one"], ["resource_type", "TestReportable"], ["updated_at", "2015-10-05 16:47:05.716285"]]
25818
+  (0.8ms) commit transaction
25819
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 5]]
25820
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 5], ["filterable_type", "ClarkKent::Report"]]
25821
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 5]]
25822
+ -------------------------
25823
+ ClarkKentTest: test_truth
25824
+ -------------------------
25825
+  (2.1ms) CREATE TABLE "clark_kent_report_columns" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "column_name" varchar(255), "column_order" integer, "report_sort" varchar(255), "summary_method" varchar(255)) 
25826
+  (0.1ms) select sqlite_version(*)
25827
+  (1.2ms) CREATE INDEX "index_clark_kent_report_columns_on_report_id" ON "clark_kent_report_columns" ("report_id")
25828
+  (1.1ms) CREATE TABLE "clark_kent_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "when_to_send" varchar(255), "name" varchar(255))
25829
+  (1.0ms) CREATE TABLE "clark_kent_report_filters" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "filterable_id" integer, "filterable_type" varchar(255) DEFAULT 'ClarkKent::Report', "string" varchar(255) DEFAULT 'ClarkKent::Report', "filter_name" varchar(255), "filter_value" varchar(255), "type" varchar(255), "duration" varchar(255), "kind_of_day" varchar(255), "offset" varchar(255), "created_at" datetime, "updated_at" datetime) 
25830
+  (0.9ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_id" ON "clark_kent_report_filters" ("filterable_id")
25831
+  (0.1ms)  SELECT sql
25832
+ FROM sqlite_master
25833
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
25834
+ UNION ALL
25835
+ SELECT sql
25836
+ FROM sqlite_temp_master
25837
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
25838
+ 
25839
+  (0.9ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_type" ON "clark_kent_report_filters" ("filterable_type")
25840
+  (1.0ms) CREATE TABLE "clark_kent_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "resource_type" varchar(255), "sharing_scope_type" varchar(255), "sharing_scope_id" integer, "created_at" datetime, "updated_at" datetime) 
25841
+  (1.0ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_id" ON "clark_kent_reports" ("sharing_scope_id")
25842
+  (0.1ms)  SELECT sql
25843
+ FROM sqlite_master
25844
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
25845
+ UNION ALL
25846
+ SELECT sql
25847
+ FROM sqlite_temp_master
25848
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
25849
+ 
25850
+  (0.9ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_type" ON "clark_kent_reports" ("sharing_scope_type")
25851
+  (0.9ms) CREATE TABLE "clark_kent_user_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "report_email_id" integer) 
25852
+  (0.8ms) CREATE TABLE "departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255))
25853
+  (0.9ms) CREATE TABLE "orders" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "amount" integer, "description" varchar(255), "created_at" datetime, "updated_at" datetime) 
25854
+  (1.1ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "email" varchar(255), "age" integer, "department_id" integer)
25855
+  (1.0ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
25856
+  (1.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
25857
+  (0.1ms) SELECT version FROM "schema_migrations"
25858
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150313144015')
25859
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170042')
25860
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170112')
25861
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140114010048')
25862
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140129051754')
25863
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150304233739')
25864
+  (0.1ms) begin transaction
25865
+ SQL (0.6ms) INSERT INTO "clark_kent_reports" ("created_at", "resource_type", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-05 16:52:10.503033"], ["resource_type", "Order"], ["updated_at", "2015-10-05 16:52:10.503033"]]
25866
+  (0.8ms) commit transaction
25867
+  (0.0ms) begin transaction
25868
+ SQL (0.3ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "user_name"], ["column_order", 1], ["report_id", 1]]
25869
+  (0.9ms) commit transaction
25870
+  (0.1ms) begin transaction
25871
+ SQL (0.4ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "id"], ["column_order", 2], ["report_id", 1]]
25872
+  (0.8ms) commit transaction
25873
+  (0.1ms) begin transaction
25874
+ SQL (0.2ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "amount"], ["column_order", 3], ["report_id", 1]]
25875
+  (0.7ms) commit transaction
25876
+  (0.2ms) begin transaction
25877
+ SQL (0.3ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "description"], ["column_order", 4], ["report_id", 1]]
25878
+  (0.9ms) commit transaction
25879
+  (0.0ms) begin transaction
25880
+ SQL (0.4ms) INSERT INTO "departments" ("name") VALUES (?) [["name", "silly walks"]]
25881
+  (0.8ms) commit transaction
25882
+  (0.1ms) begin transaction
25883
+ SQL (0.3ms) INSERT INTO "users" ("department_id", "email", "name") VALUES (?, ?, ?) [["department_id", 1], ["email", "taproot@gmail.com"], ["name", "Michael Hedges"]]
25884
+  (0.8ms) commit transaction
25885
+  (0.1ms) begin transaction
25886
+ SQL (0.4ms) INSERT INTO "orders" ("amount", "created_at", "description", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["amount", 1], ["created_at", "2015-10-05 16:52:10.563177"], ["description", "Guitar strings"], ["updated_at", "2015-10-05 16:52:10.563177"], ["user_id", 1]]
25887
+  (0.7ms) commit transaction
25888
+ -------------------------------------------------------------------
25889
+ ClarkKent::ReportableTest: test_it_adds_required_filters_if_present
25890
+ -------------------------------------------------------------------
25891
+  (0.1ms) begin transaction
25892
+ SQL (0.3ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-10-05 16:52:10.600915"], ["name", "test one"], ["resource_type", "Order"], ["updated_at", "2015-10-05 16:52:10.600915"]]
25893
+  (0.7ms) commit transaction
25894
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 2]]
25895
+ ClarkKent::ReportFilter Load (0.2ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 2], ["filterable_type", "ClarkKent::Report"]]
25896
+ ---------------------------------------------------------------------
25897
+ ClarkKent::ReportableTest: test_it_works_without_any_required_filters
25898
+ ---------------------------------------------------------------------
25899
+  (0.1ms) begin transaction
25900
+ SQL (0.3ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-10-05 16:52:10.610615"], ["name", "test one"], ["resource_type", "TestReportable"], ["updated_at", "2015-10-05 16:52:10.610615"]]
25901
+  (0.7ms) commit transaction
25902
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 3]]
25903
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 3], ["filterable_type", "ClarkKent::Report"]]
25904
+ ---------------------------------------------------
25905
+ ClarkKent::ReportEmailTest: test_sends_report_to_s3
25906
+ ---------------------------------------------------
25907
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
25908
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25909
+ SQL (1.2ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
25910
+  (0.0ms) begin transaction
25911
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
25912
+  (0.9ms) commit transaction
25913
+  (0.1ms) begin transaction
25914
+ SQL (0.4ms) INSERT INTO "clark_kent_report_filters" ("created_at", "duration", "filter_name", "filterable_id", "filterable_type", "kind_of_day", "offset", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-10-05 16:52:10.648867"], ["duration", "week"], ["filter_name", "created_at"], ["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"], ["kind_of_day", "Monday"], ["offset", "this_week"], ["type", "ClarkKent::ReportDateFilter"], ["updated_at", "2015-10-05 16:52:10.648867"]]
25915
+  (1.2ms) commit transaction
25916
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
25917
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
25918
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
25919
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
25920
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
25921
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
25922
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
25923
+ -----------------------------------------------------------------------------------------
25924
+ ClarkKent::ReportEmailTest: test_throws_an_error_if_required_date_filters_are_not_present
25925
+ -----------------------------------------------------------------------------------------
25926
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
25927
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25928
+ SQL (1.2ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
25929
+  (0.1ms) begin transaction
25930
+ SQL (0.2ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
25931
+  (0.6ms) commit transaction
25932
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
25933
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
25934
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
25935
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
25936
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 2]]
25937
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 2]]
25938
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 2], ["filterable_type", "ClarkKent::Report"]]
25939
+ ------------------------------------------------------------------------------------------------
25940
+ ClarkKent::ReportTest: test_can't_save_without_a_sharing_scope_id_if_the_sharing_scope_is_custom
25941
+ ------------------------------------------------------------------------------------------------
25942
+  (0.1ms) begin transaction
25943
+  (0.1ms) rollback transaction
25944
+ -------------------------
25945
+ ClarkKentTest: test_truth
25946
+ -------------------------
25947
+ -----------------------------------------------------------
25948
+ ClarkKent::ReportsControllerTest: test_should_create_report
25949
+ -----------------------------------------------------------
25950
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25951
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
25952
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
25953
+ Processing by ClarkKent::ReportsController#create as HTML
25954
+ Parameters: {"report"=>{"name"=>"delete me", "resource_type"=>"Order", "sharing_scope_id"=>"1", "sharing_scope_type"=>"Department"}, "current_user_id"=>"1"}
25955
+  (0.1ms) begin transaction
25956
+ SQL (0.3ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "sharing_scope_id", "sharing_scope_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-10-05 16:52:10.759137"], ["name", "delete me"], ["resource_type", "Order"], ["sharing_scope_id", 1], ["sharing_scope_type", "Department"], ["updated_at", "2015-10-05 16:52:10.759137"]]
25957
+  (1.0ms) commit transaction
25958
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
25959
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (3.1ms)
25960
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 4], ["filterable_type", "ClarkKent::Report"]]
25961
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_index.html.erb (1.9ms)
25962
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 4]]
25963
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_index.html.erb (2.0ms)
25964
+ ClarkKent::ReportEmail Load (0.1ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 4]]
25965
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_index.html.erb (1.4ms)
25966
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/edit.html.erb within layouts/application (20.5ms)
25967
+ Completed 200 OK in 156ms (Views: 152.6ms | ActiveRecord: 1.8ms)
25968
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
25969
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."name" = 'delete me' LIMIT 1
25970
+  (0.0ms) begin transaction
25971
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 4], ["filterable_type", "ClarkKent::Report"]]
25972
+ ClarkKent::ReportColumn Load (0.0ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 4]]
25973
+ ClarkKent::ReportEmail Load (0.0ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 4]]
25974
+ SQL (0.3ms) DELETE FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? [["id", 4]]
25975
+  (1.3ms) commit transaction
25976
+ ------------------------------------------------------------
25977
+ ClarkKent::ReportsControllerTest: test_should_destroy_report
25978
+ ------------------------------------------------------------
25979
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
25980
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
25981
+  (0.0ms) begin transaction
25982
+ SQL (0.2ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-10-05 16:52:10.921841"], ["name", "delete me"], ["resource_type", "Order"], ["updated_at", "2015-10-05 16:52:10.921841"]]
25983
+  (0.7ms) commit transaction
25984
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
25985
+ Processing by ClarkKent::ReportsController#destroy as HTML
25986
+ Parameters: {"current_user_id"=>"1", "id"=>"5"}
25987
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 5]]
25988
+  (0.1ms) begin transaction
25989
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 5], ["filterable_type", "ClarkKent::Report"]]
25990
+ ClarkKent::ReportColumn Load (0.0ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 5]]
25991
+ ClarkKent::ReportEmail Load (0.0ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 5]]
25992
+ SQL (0.2ms) DELETE FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? [["id", 5]]
25993
+  (0.7ms) commit transaction
25994
+ Redirected to http://test.host/reports/reports
25995
+ Completed 302 Found in 5ms (ActiveRecord: 1.3ms)
25996
+  (0.2ms) SELECT COUNT(*) FROM "clark_kent_reports"
25997
+ ------------------------------------------------------
25998
+ ClarkKent::ReportsControllerTest: test_should_get_edit
25999
+ ------------------------------------------------------
26000
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26001
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
26002
+ Processing by ClarkKent::ReportsController#edit as HTML
26003
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
26004
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
26005
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
26006
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (1.3ms)
26007
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26008
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_index.html.erb (1.0ms)
26009
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
26010
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.8ms)
26011
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (3.7ms)
26012
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.3ms)
26013
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.4ms)
26014
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.2ms)
26015
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.4ms)
26016
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.3ms)
26017
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.4ms)
26018
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_index.html.erb (8.3ms)
26019
+ ClarkKent::ReportEmail Load (0.1ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 1]]
26020
+ ClarkKent::ReportDateFilter Load (0.2ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."type" IN ('ClarkKent::ReportDateFilter') AND "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"]]
26021
+ User Load (0.2ms) SELECT "users".* FROM "users" INNER JOIN "clark_kent_user_report_emails" ON "users"."id" = "clark_kent_user_report_emails"."user_id" WHERE "clark_kent_user_report_emails"."report_email_id" = ? [["report_email_id", 1]]
26022
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show.html.erb (15.9ms)
26023
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show_wrapper.html.erb (18.3ms)
26024
+ ClarkKent::ReportDateFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."type" IN ('ClarkKent::ReportDateFilter') AND "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 2], ["filterable_type", "ClarkKent::ReportEmail"]]
26025
+ User Load (0.1ms) SELECT "users".* FROM "users" INNER JOIN "clark_kent_user_report_emails" ON "users"."id" = "clark_kent_user_report_emails"."user_id" WHERE "clark_kent_user_report_emails"."report_email_id" = ? [["report_email_id", 2]]
26026
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show.html.erb (2.1ms)
26027
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show_wrapper.html.erb (2.3ms)
26028
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_index.html.erb (23.7ms)
26029
+ Completed 200 OK in 37ms (Views: 35.6ms | ActiveRecord: 1.1ms)
26030
+ -------------------------------------------------------
26031
+ ClarkKent::ReportsControllerTest: test_should_get_index
26032
+ -------------------------------------------------------
26033
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26034
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
26035
+ Processing by ClarkKent::ReportsController#index as HTML
26036
+ Parameters: {"current_user_id"=>"1"}
26037
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
26038
+ ClarkKent::Report Exists (0.2ms) SELECT 1 AS one FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" = ? AND "clark_kent_reports"."sharing_scope_type" = ? LIMIT 1 [["sharing_scope_id", 1], ["sharing_scope_type", "User"]]
26039
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
26040
+ ClarkKent::Report Exists (0.1ms) SELECT 1 AS one FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" = ? AND "clark_kent_reports"."sharing_scope_type" = ? LIMIT 1 [["sharing_scope_id", 1], ["sharing_scope_type", "Department"]]
26041
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" = ? AND "clark_kent_reports"."sharing_scope_type" = ? [["sharing_scope_id", 1], ["sharing_scope_type", "Department"]]
26042
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" IS NULL
26043
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" IS NULL
26044
+ Completed 200 OK in 13ms (Views: 11.8ms | ActiveRecord: 0.7ms)
26045
+ -----------------------------------------------------
26046
+ ClarkKent::ReportsControllerTest: test_should_get_new
26047
+ -----------------------------------------------------
26048
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26049
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
26050
+ Processing by ClarkKent::ReportsController#new as HTML
26051
+ Parameters: {"current_user_id"=>"1"}
26052
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
26053
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
26054
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_edit.html.erb (37.4ms)
26055
+ Completed 200 OK in 44ms (Views: 43.3ms | ActiveRecord: 0.2ms)
26056
+ ---------------------------------------------------------
26057
+ ClarkKent::ReportsControllerTest: test_should_show_report
26058
+ ---------------------------------------------------------
26059
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26060
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
26061
+ Processing by ClarkKent::ReportsController#show as HTML
26062
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
26063
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = 1 ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26064
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" IN (1) ORDER BY clark_kent_report_columns.column_order
26065
+  (0.2ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26066
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26067
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26068
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.7ms)
26069
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
26070
+ User Load (0.1ms) SELECT "users".* FROM "users"
26071
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (1.4ms)
26072
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.4ms)
26073
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (0.9ms)
26074
+ Completed 200 OK in 23ms (Views: 18.5ms | ActiveRecord: 0.9ms)
26075
+ -----------------------------------------------------------------
26076
+ ClarkKent::ReportsControllerTest: test_should_show_report_results
26077
+ -----------------------------------------------------------------
26078
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26079
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
26080
+ Processing by ClarkKent::ReportsController#show as HTML
26081
+ Parameters: {"current_user_id"=>"1", "run_report"=>true, "created_at_until"=>"2015-10-05", "created_at_from"=>"2015-10-04", "id"=>"1"}
26082
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = 1 ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26083
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" IN (1) ORDER BY clark_kent_report_columns.column_order
26084
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26085
+ Completed 500 Internal Server Error in 3ms
26086
+ --------------------------------------------------------------------
26087
+ ClarkKent::ReportsControllerTest: test_should_show_report_run_errors
26088
+ --------------------------------------------------------------------
26089
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26090
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
26091
+ Processing by ClarkKent::ReportsController#show as HTML
26092
+ Parameters: {"current_user_id"=>"1", "run_report"=>true, "id"=>"1"}
26093
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = 1 ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26094
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" IN (1) ORDER BY clark_kent_report_columns.column_order
26095
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26096
+ Completed 500 Internal Server Error in 4ms
26097
+ -----------------------------------------------------------
26098
+ ClarkKent::ReportsControllerTest: test_should_update_report
26099
+ -----------------------------------------------------------
26100
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26101
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
26102
+ Processing by ClarkKent::ReportsController#update as HTML
26103
+ Parameters: {"report"=>{"name"=>nil, "resource_type"=>"Order", "sharing_scope_id"=>"1", "sharing_scope_type"=>"Department"}, "current_user_id"=>"1", "id"=>"1"}
26104
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
26105
+  (0.1ms) begin transaction
26106
+  (0.0ms) commit transaction
26107
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
26108
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (1.5ms)
26109
+ Completed 200 OK in 3ms (Views: 1.7ms | ActiveRecord: 0.3ms)
26110
+  (1.6ms) CREATE TABLE "clark_kent_report_columns" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "column_name" varchar(255), "column_order" integer, "report_sort" varchar(255), "summary_method" varchar(255)) 
26111
+  (0.1ms) select sqlite_version(*)
26112
+  (1.0ms) CREATE INDEX "index_clark_kent_report_columns_on_report_id" ON "clark_kent_report_columns" ("report_id")
26113
+  (1.1ms) CREATE TABLE "clark_kent_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "when_to_send" varchar(255), "name" varchar(255))
26114
+  (0.8ms) CREATE TABLE "clark_kent_report_filters" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "filterable_id" integer, "filterable_type" varchar(255) DEFAULT 'ClarkKent::Report', "string" varchar(255) DEFAULT 'ClarkKent::Report', "filter_name" varchar(255), "filter_value" varchar(255), "type" varchar(255), "duration" varchar(255), "kind_of_day" varchar(255), "offset" varchar(255), "created_at" datetime, "updated_at" datetime) 
26115
+  (0.9ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_id" ON "clark_kent_report_filters" ("filterable_id")
26116
+  (0.1ms)  SELECT sql
26117
+ FROM sqlite_master
26118
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
26119
+ UNION ALL
26120
+ SELECT sql
26121
+ FROM sqlite_temp_master
26122
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
26123
+ 
26124
+  (0.8ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_type" ON "clark_kent_report_filters" ("filterable_type")
26125
+  (0.8ms) CREATE TABLE "clark_kent_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "resource_type" varchar(255), "sharing_scope_type" varchar(255), "sharing_scope_id" integer, "created_at" datetime, "updated_at" datetime) 
26126
+  (0.8ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_id" ON "clark_kent_reports" ("sharing_scope_id")
26127
+  (0.2ms)  SELECT sql
26128
+ FROM sqlite_master
26129
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
26130
+ UNION ALL
26131
+ SELECT sql
26132
+ FROM sqlite_temp_master
26133
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
26134
+ 
26135
+  (0.9ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_type" ON "clark_kent_reports" ("sharing_scope_type")
26136
+  (0.8ms) CREATE TABLE "clark_kent_user_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "report_email_id" integer) 
26137
+  (0.8ms) CREATE TABLE "departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255))
26138
+  (1.0ms) CREATE TABLE "orders" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "amount" integer, "description" varchar(255), "created_at" datetime, "updated_at" datetime) 
26139
+  (0.9ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "email" varchar(255), "age" integer, "department_id" integer)
26140
+  (1.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
26141
+  (1.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
26142
+  (0.1ms) SELECT version FROM "schema_migrations"
26143
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20150313144015')
26144
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170042')
26145
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170112')
26146
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140114010048')
26147
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140129051754')
26148
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150304233739')
26149
+  (0.1ms) begin transaction
26150
+ SQL (0.4ms) INSERT INTO "clark_kent_reports" ("created_at", "resource_type", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-05 16:53:35.393675"], ["resource_type", "Order"], ["updated_at", "2015-10-05 16:53:35.393675"]]
26151
+  (1.1ms) commit transaction
26152
+  (0.0ms) begin transaction
26153
+ SQL (0.3ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "user_name"], ["column_order", 1], ["report_id", 1]]
26154
+  (0.8ms) commit transaction
26155
+  (0.1ms) begin transaction
26156
+ SQL (0.2ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "id"], ["column_order", 2], ["report_id", 1]]
26157
+  (0.7ms) commit transaction
26158
+  (0.0ms) begin transaction
26159
+ SQL (0.2ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "amount"], ["column_order", 3], ["report_id", 1]]
26160
+  (0.7ms) commit transaction
26161
+  (0.0ms) begin transaction
26162
+ SQL (0.2ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "description"], ["column_order", 4], ["report_id", 1]]
26163
+  (0.7ms) commit transaction
26164
+  (0.1ms) begin transaction
26165
+ SQL (0.3ms) INSERT INTO "departments" ("name") VALUES (?) [["name", "silly walks"]]
26166
+  (0.7ms) commit transaction
26167
+  (0.0ms) begin transaction
26168
+ SQL (0.3ms) INSERT INTO "users" ("department_id", "email", "name") VALUES (?, ?, ?) [["department_id", 1], ["email", "taproot@gmail.com"], ["name", "Michael Hedges"]]
26169
+  (0.7ms) commit transaction
26170
+  (0.0ms) begin transaction
26171
+ SQL (0.3ms) INSERT INTO "orders" ("amount", "created_at", "description", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["amount", 1], ["created_at", "2015-10-05 16:53:35.451631"], ["description", "Guitar strings"], ["updated_at", "2015-10-05 16:53:35.451631"], ["user_id", 1]]
26172
+  (0.7ms) commit transaction
26173
+ -----------------------------------------------------------
26174
+ ClarkKent::ReportsControllerTest: test_should_create_report
26175
+ -----------------------------------------------------------
26176
+ ClarkKent::Report Load (0.3ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26177
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
26178
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
26179
+ Processing by ClarkKent::ReportsController#create as HTML
26180
+ Parameters: {"report"=>{"name"=>"delete me", "resource_type"=>"Order", "sharing_scope_id"=>nil, "sharing_scope_type"=>nil}, "current_user_id"=>"1"}
26181
+  (0.1ms) begin transaction
26182
+ SQL (0.3ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-10-05 16:53:35.511987"], ["name", "delete me"], ["resource_type", "Order"], ["updated_at", "2015-10-05 16:53:35.511987"]]
26183
+  (1.1ms) commit transaction
26184
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (4.1ms)
26185
+ ClarkKent::ReportFilter Load (0.2ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 2], ["filterable_type", "ClarkKent::Report"]]
26186
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_index.html.erb (5.1ms)
26187
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 2]]
26188
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_index.html.erb (1.8ms)
26189
+ ClarkKent::ReportEmail Load (0.1ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 2]]
26190
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_index.html.erb (6.6ms)
26191
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/edit.html.erb within layouts/application (33.2ms)
26192
+ Completed 200 OK in 184ms (Views: 180.3ms | ActiveRecord: 2.2ms)
26193
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
26194
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."name" = 'delete me' LIMIT 1
26195
+  (0.1ms) begin transaction
26196
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 2], ["filterable_type", "ClarkKent::Report"]]
26197
+ ClarkKent::ReportColumn Load (0.0ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 2]]
26198
+ ClarkKent::ReportEmail Load (0.0ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 2]]
26199
+ SQL (0.2ms) DELETE FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? [["id", 2]]
26200
+  (1.6ms) commit transaction
26201
+ ------------------------------------------------------------
26202
+ ClarkKent::ReportsControllerTest: test_should_destroy_report
26203
+ ------------------------------------------------------------
26204
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26205
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
26206
+  (0.0ms) begin transaction
26207
+ SQL (0.3ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-10-05 16:53:35.705164"], ["name", "delete me"], ["resource_type", "Order"], ["updated_at", "2015-10-05 16:53:35.705164"]]
26208
+  (0.9ms) commit transaction
26209
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
26210
+ Processing by ClarkKent::ReportsController#destroy as HTML
26211
+ Parameters: {"current_user_id"=>"1", "id"=>"3"}
26212
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 3]]
26213
+  (0.0ms) begin transaction
26214
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 3], ["filterable_type", "ClarkKent::Report"]]
26215
+ ClarkKent::ReportColumn Load (0.0ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 3]]
26216
+ ClarkKent::ReportEmail Load (0.0ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 3]]
26217
+ SQL (0.2ms) DELETE FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? [["id", 3]]
26218
+  (0.6ms) commit transaction
26219
+ Redirected to http://test.host/reports/reports
26220
+ Completed 302 Found in 4ms (ActiveRecord: 1.2ms)
26221
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
26222
+ ------------------------------------------------------
26223
+ ClarkKent::ReportsControllerTest: test_should_get_edit
26224
+ ------------------------------------------------------
26225
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26226
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
26227
+ Processing by ClarkKent::ReportsController#edit as HTML
26228
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
26229
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
26230
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (0.9ms)
26231
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26232
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_index.html.erb (1.4ms)
26233
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
26234
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.9ms)
26235
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (3.5ms)
26236
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.3ms)
26237
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.5ms)
26238
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.3ms)
26239
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.4ms)
26240
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.3ms)
26241
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.4ms)
26242
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_index.html.erb (8.8ms)
26243
+ ClarkKent::ReportEmail Load (0.1ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 1]]
26244
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_index.html.erb (0.9ms)
26245
+ Completed 200 OK in 15ms (Views: 14.2ms | ActiveRecord: 0.4ms)
26246
+ -------------------------------------------------------
26247
+ ClarkKent::ReportsControllerTest: test_should_get_index
26248
+ -------------------------------------------------------
26249
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26250
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
26251
+ Processing by ClarkKent::ReportsController#index as HTML
26252
+ Parameters: {"current_user_id"=>"1"}
26253
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
26254
+ ClarkKent::Report Exists (0.2ms) SELECT 1 AS one FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" = ? AND "clark_kent_reports"."sharing_scope_type" = ? LIMIT 1 [["sharing_scope_id", 1], ["sharing_scope_type", "User"]]
26255
+ Department Load (0.2ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
26256
+ ClarkKent::Report Exists (0.1ms) SELECT 1 AS one FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" = ? AND "clark_kent_reports"."sharing_scope_type" = ? LIMIT 1 [["sharing_scope_id", 1], ["sharing_scope_type", "Department"]]
26257
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" IS NULL
26258
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" IS NULL
26259
+ Completed 200 OK in 19ms (Views: 17.5ms | ActiveRecord: 0.8ms)
26260
+ -----------------------------------------------------
26261
+ ClarkKent::ReportsControllerTest: test_should_get_new
26262
+ -----------------------------------------------------
26263
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26264
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
26265
+ Processing by ClarkKent::ReportsController#new as HTML
26266
+ Parameters: {"current_user_id"=>"1"}
26267
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
26268
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
26269
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_edit.html.erb (41.2ms)
26270
+ Completed 200 OK in 48ms (Views: 47.7ms | ActiveRecord: 0.2ms)
26271
+ ---------------------------------------------------------
26272
+ ClarkKent::ReportsControllerTest: test_should_show_report
26273
+ ---------------------------------------------------------
26274
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26275
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
26276
+ Processing by ClarkKent::ReportsController#show as HTML
26277
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
26278
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = 1 ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26279
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" IN (1) ORDER BY clark_kent_report_columns.column_order
26280
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26281
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26282
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26283
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.9ms)
26284
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
26285
+ User Load (0.1ms) SELECT "users".* FROM "users"
26286
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (1.4ms)
26287
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.4ms)
26288
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (0.4ms)
26289
+ Completed 200 OK in 23ms (Views: 18.2ms | ActiveRecord: 1.0ms)
26290
+ -----------------------------------------------------------------
26291
+ ClarkKent::ReportsControllerTest: test_should_show_report_results
26292
+ -----------------------------------------------------------------
26293
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26294
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
26295
+ Processing by ClarkKent::ReportsController#show as HTML
26296
+ Parameters: {"current_user_id"=>"1", "run_report"=>true, "created_at_until"=>"2015-10-05", "created_at_from"=>"2015-10-04", "id"=>"1"}
26297
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = 1 ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26298
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" IN (1) ORDER BY clark_kent_report_columns.column_order
26299
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26300
+ Completed 500 Internal Server Error in 3ms
26301
+ --------------------------------------------------------------------
26302
+ ClarkKent::ReportsControllerTest: test_should_show_report_run_errors
26303
+ --------------------------------------------------------------------
26304
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26305
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
26306
+ Processing by ClarkKent::ReportsController#show as HTML
26307
+ Parameters: {"current_user_id"=>"1", "run_report"=>true, "id"=>"1"}
26308
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = 1 ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26309
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" IN (1) ORDER BY clark_kent_report_columns.column_order
26310
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26311
+ Completed 500 Internal Server Error in 3ms
26312
+ -----------------------------------------------------------
26313
+ ClarkKent::ReportsControllerTest: test_should_update_report
26314
+ -----------------------------------------------------------
26315
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26316
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
26317
+ Processing by ClarkKent::ReportsController#update as HTML
26318
+ Parameters: {"report"=>{"name"=>nil, "resource_type"=>"Order", "sharing_scope_id"=>nil, "sharing_scope_type"=>nil}, "current_user_id"=>"1", "id"=>"1"}
26319
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
26320
+  (0.1ms) begin transaction
26321
+  (0.0ms) commit transaction
26322
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (0.9ms)
26323
+ Completed 200 OK in 4ms (Views: 1.3ms | ActiveRecord: 0.2ms)
26324
+ ---------------------------------------------------
26325
+ ClarkKent::ReportEmailTest: test_sends_report_to_s3
26326
+ ---------------------------------------------------
26327
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
26328
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26329
+ SQL (1.7ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
26330
+  (0.1ms) begin transaction
26331
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
26332
+  (0.8ms) commit transaction
26333
+  (0.1ms) begin transaction
26334
+ SQL (0.4ms) INSERT INTO "clark_kent_report_filters" ("created_at", "duration", "filter_name", "filterable_id", "filterable_type", "kind_of_day", "offset", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-10-05 16:53:35.873116"], ["duration", "week"], ["filter_name", "created_at"], ["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"], ["kind_of_day", "Monday"], ["offset", "this_week"], ["type", "ClarkKent::ReportDateFilter"], ["updated_at", "2015-10-05 16:53:35.873116"]]
26335
+  (0.7ms) commit transaction
26336
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
26337
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
26338
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26339
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
26340
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
26341
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
26342
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26343
+ -----------------------------------------------------------------------------------------
26344
+ ClarkKent::ReportEmailTest: test_throws_an_error_if_required_date_filters_are_not_present
26345
+ -----------------------------------------------------------------------------------------
26346
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
26347
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26348
+ SQL (2.6ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
26349
+  (0.1ms) begin transaction
26350
+ SQL (0.2ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
26351
+  (0.6ms) commit transaction
26352
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
26353
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
26354
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26355
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
26356
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 2]]
26357
+ -------------------------
26358
+ ClarkKentTest: test_truth
26359
+ -------------------------
26360
+ -------------------------------------------------------------------
26361
+ ClarkKent::ReportableTest: test_it_adds_required_filters_if_present
26362
+ -------------------------------------------------------------------
26363
+  (0.1ms) begin transaction
26364
+ SQL (0.3ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-10-05 16:53:35.940123"], ["name", "test one"], ["resource_type", "Order"], ["updated_at", "2015-10-05 16:53:35.940123"]]
26365
+  (0.7ms) commit transaction
26366
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 4]]
26367
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 4], ["filterable_type", "ClarkKent::Report"]]
26368
+ ---------------------------------------------------------------------
26369
+ ClarkKent::ReportableTest: test_it_works_without_any_required_filters
26370
+ ---------------------------------------------------------------------
26371
+  (0.1ms) begin transaction
26372
+ SQL (0.3ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-10-05 16:53:35.944362"], ["name", "test one"], ["resource_type", "TestReportable"], ["updated_at", "2015-10-05 16:53:35.944362"]]
26373
+  (0.8ms) commit transaction
26374
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 5]]
26375
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 5], ["filterable_type", "ClarkKent::Report"]]
26376
+ ------------------------------------------------------------------------------------------------
26377
+ ClarkKent::ReportTest: test_can't_save_without_a_sharing_scope_id_if_the_sharing_scope_is_custom
26378
+ ------------------------------------------------------------------------------------------------
26379
+  (0.1ms) begin transaction
26380
+  (0.0ms) rollback transaction
26381
+  (1.9ms) CREATE TABLE "clark_kent_report_columns" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "column_name" varchar(255), "column_order" integer, "report_sort" varchar(255), "summary_method" varchar(255)) 
26382
+  (0.1ms) select sqlite_version(*)
26383
+  (1.0ms) CREATE INDEX "index_clark_kent_report_columns_on_report_id" ON "clark_kent_report_columns" ("report_id")
26384
+  (0.9ms) CREATE TABLE "clark_kent_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "when_to_send" varchar(255), "name" varchar(255))
26385
+  (0.9ms) CREATE TABLE "clark_kent_report_filters" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "filterable_id" integer, "filterable_type" varchar(255) DEFAULT 'ClarkKent::Report', "string" varchar(255) DEFAULT 'ClarkKent::Report', "filter_name" varchar(255), "filter_value" varchar(255), "type" varchar(255), "duration" varchar(255), "kind_of_day" varchar(255), "offset" varchar(255), "created_at" datetime, "updated_at" datetime) 
26386
+  (0.9ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_id" ON "clark_kent_report_filters" ("filterable_id")
26387
+  (0.1ms)  SELECT sql
26388
+ FROM sqlite_master
26389
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
26390
+ UNION ALL
26391
+ SELECT sql
26392
+ FROM sqlite_temp_master
26393
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
26394
+ 
26395
+  (0.9ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_type" ON "clark_kent_report_filters" ("filterable_type")
26396
+  (1.0ms) CREATE TABLE "clark_kent_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "resource_type" varchar(255), "sharing_scope_type" varchar(255), "sharing_scope_id" integer, "created_at" datetime, "updated_at" datetime) 
26397
+  (1.0ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_id" ON "clark_kent_reports" ("sharing_scope_id")
26398
+  (0.1ms)  SELECT sql
26399
+ FROM sqlite_master
26400
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
26401
+ UNION ALL
26402
+ SELECT sql
26403
+ FROM sqlite_temp_master
26404
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
26405
+ 
26406
+  (0.8ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_type" ON "clark_kent_reports" ("sharing_scope_type")
26407
+  (0.9ms) CREATE TABLE "clark_kent_user_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "report_email_id" integer) 
26408
+  (1.0ms) CREATE TABLE "departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255))
26409
+  (0.9ms) CREATE TABLE "orders" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "amount" integer, "description" varchar(255), "created_at" datetime, "updated_at" datetime) 
26410
+  (0.8ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "email" varchar(255), "age" integer, "department_id" integer)
26411
+  (1.0ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
26412
+  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
26413
+  (0.1ms) SELECT version FROM "schema_migrations"
26414
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20150313144015')
26415
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170042')
26416
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170112')
26417
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140114010048')
26418
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140129051754')
26419
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150304233739')
26420
+  (0.0ms) begin transaction
26421
+ SQL (0.4ms) INSERT INTO "clark_kent_reports" ("created_at", "resource_type", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-05 16:54:37.814569"], ["resource_type", "Order"], ["updated_at", "2015-10-05 16:54:37.814569"]]
26422
+  (0.7ms) commit transaction
26423
+  (0.1ms) begin transaction
26424
+ SQL (0.3ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "user_name"], ["column_order", 1], ["report_id", 1]]
26425
+  (0.7ms) commit transaction
26426
+  (0.1ms) begin transaction
26427
+ SQL (0.3ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "id"], ["column_order", 2], ["report_id", 1]]
26428
+  (0.9ms) commit transaction
26429
+  (0.1ms) begin transaction
26430
+ SQL (0.2ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "amount"], ["column_order", 3], ["report_id", 1]]
26431
+  (0.9ms) commit transaction
26432
+  (0.1ms) begin transaction
26433
+ SQL (0.2ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "description"], ["column_order", 4], ["report_id", 1]]
26434
+  (0.8ms) commit transaction
26435
+  (0.0ms) begin transaction
26436
+ SQL (0.3ms) INSERT INTO "departments" ("name") VALUES (?) [["name", "silly walks"]]
26437
+  (0.7ms) commit transaction
26438
+  (0.1ms) begin transaction
26439
+ SQL (0.4ms) INSERT INTO "users" ("department_id", "email", "name") VALUES (?, ?, ?) [["department_id", 1], ["email", "taproot@gmail.com"], ["name", "Michael Hedges"]]
26440
+  (0.9ms) commit transaction
26441
+  (0.1ms) begin transaction
26442
+ SQL (0.3ms) INSERT INTO "orders" ("amount", "created_at", "description", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["amount", 1], ["created_at", "2015-10-05 16:54:37.865916"], ["description", "Guitar strings"], ["updated_at", "2015-10-05 16:54:37.865916"], ["user_id", 1]]
26443
+  (0.7ms) commit transaction
26444
+ -------------------------
26445
+ ClarkKentTest: test_truth
26446
+ -------------------------
26447
+ -------------------------------------------------------------------
26448
+ ClarkKent::ReportableTest: test_it_adds_required_filters_if_present
26449
+ -------------------------------------------------------------------
26450
+  (0.1ms) begin transaction
26451
+ SQL (0.3ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-10-05 16:54:37.916408"], ["name", "test one"], ["resource_type", "Order"], ["updated_at", "2015-10-05 16:54:37.916408"]]
26452
+  (1.0ms) commit transaction
26453
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 2]]
26454
+ ClarkKent::ReportFilter Load (0.2ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 2], ["filterable_type", "ClarkKent::Report"]]
26455
+ ClarkKent::ReportColumn Load (0.4ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 2]]
26456
+ ---------------------------------------------------------------------
26457
+ ClarkKent::ReportableTest: test_it_works_without_any_required_filters
26458
+ ---------------------------------------------------------------------
26459
+  (0.1ms) begin transaction
26460
+ SQL (0.3ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-10-05 16:55:00.040945"], ["name", "test one"], ["resource_type", "TestReportable"], ["updated_at", "2015-10-05 16:55:00.040945"]]
26461
+  (1.1ms) commit transaction
26462
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 3]]
26463
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 3], ["filterable_type", "ClarkKent::Report"]]
26464
+ ClarkKent::ReportColumn Load (0.3ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 3]]
26465
+ ------------------------------------------------------------------------------------------------
26466
+ ClarkKent::ReportTest: test_can't_save_without_a_sharing_scope_id_if_the_sharing_scope_is_custom
26467
+ ------------------------------------------------------------------------------------------------
26468
+  (0.1ms) begin transaction
26469
+  (0.1ms) rollback transaction
26470
+ -----------------------------------------------------------
26471
+ ClarkKent::ReportsControllerTest: test_should_create_report
26472
+ -----------------------------------------------------------
26473
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26474
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
26475
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
26476
+ Processing by ClarkKent::ReportsController#create as HTML
26477
+ Parameters: {"report"=>{"name"=>"delete me", "resource_type"=>"Order", "sharing_scope_id"=>nil, "sharing_scope_type"=>nil}, "current_user_id"=>"1"}
26478
+  (0.1ms) begin transaction
26479
+ SQL (0.3ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-10-05 16:55:09.097528"], ["name", "delete me"], ["resource_type", "Order"], ["updated_at", "2015-10-05 16:55:09.097528"]]
26480
+  (1.8ms) commit transaction
26481
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (3.8ms)
26482
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 4], ["filterable_type", "ClarkKent::Report"]]
26483
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_index.html.erb (2.0ms)
26484
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 4]]
26485
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_index.html.erb (1.8ms)
26486
+ ClarkKent::ReportEmail Load (0.1ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 4]]
26487
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_index.html.erb (6.7ms)
26488
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/edit.html.erb within layouts/application (27.6ms)
26489
+ Completed 200 OK in 222ms (Views: 217.2ms | ActiveRecord: 2.6ms)
26490
+  (0.2ms) SELECT COUNT(*) FROM "clark_kent_reports"
26491
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."name" = 'delete me' LIMIT 1
26492
+  (0.0ms) begin transaction
26493
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 4], ["filterable_type", "ClarkKent::Report"]]
26494
+ ClarkKent::ReportColumn Load (0.0ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 4]]
26495
+ ClarkKent::ReportEmail Load (0.0ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 4]]
26496
+ SQL (0.2ms) DELETE FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? [["id", 4]]
26497
+  (1.5ms) commit transaction
26498
+ ------------------------------------------------------------
26499
+ ClarkKent::ReportsControllerTest: test_should_destroy_report
26500
+ ------------------------------------------------------------
26501
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26502
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
26503
+  (0.0ms) begin transaction
26504
+ SQL (0.6ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-10-05 16:55:09.328574"], ["name", "delete me"], ["resource_type", "Order"], ["updated_at", "2015-10-05 16:55:09.328574"]]
26505
+  (1.0ms) commit transaction
26506
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
26507
+ Processing by ClarkKent::ReportsController#destroy as HTML
26508
+ Parameters: {"current_user_id"=>"1", "id"=>"5"}
26509
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 5]]
26510
+  (0.0ms) begin transaction
26511
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 5], ["filterable_type", "ClarkKent::Report"]]
26512
+ ClarkKent::ReportColumn Load (0.0ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 5]]
26513
+ ClarkKent::ReportEmail Load (0.0ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 5]]
26514
+ SQL (0.2ms) DELETE FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? [["id", 5]]
26515
+  (0.8ms) commit transaction
26516
+ Redirected to http://test.host/reports/reports
26517
+ Completed 302 Found in 5ms (ActiveRecord: 1.3ms)
26518
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
26519
+ ------------------------------------------------------
26520
+ ClarkKent::ReportsControllerTest: test_should_get_edit
26521
+ ------------------------------------------------------
26522
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26523
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
26524
+ Processing by ClarkKent::ReportsController#edit as HTML
26525
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
26526
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
26527
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (0.7ms)
26528
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26529
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_index.html.erb (1.2ms)
26530
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
26531
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.7ms)
26532
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (3.2ms)
26533
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.3ms)
26534
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.4ms)
26535
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.3ms)
26536
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.4ms)
26537
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.3ms)
26538
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.4ms)
26539
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_index.html.erb (7.9ms)
26540
+ ClarkKent::ReportEmail Load (0.1ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 1]]
26541
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_index.html.erb (0.9ms)
26542
+ Completed 200 OK in 14ms (Views: 12.9ms | ActiveRecord: 0.3ms)
26543
+ -------------------------------------------------------
26544
+ ClarkKent::ReportsControllerTest: test_should_get_index
26545
+ -------------------------------------------------------
26546
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26547
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
26548
+ Processing by ClarkKent::ReportsController#index as HTML
26549
+ Parameters: {"current_user_id"=>"1"}
26550
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
26551
+ ClarkKent::Report Exists (0.2ms) SELECT 1 AS one FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" = ? AND "clark_kent_reports"."sharing_scope_type" = ? LIMIT 1 [["sharing_scope_id", 1], ["sharing_scope_type", "User"]]
26552
+ Department Load (0.2ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
26553
+ ClarkKent::Report Exists (0.1ms) SELECT 1 AS one FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" = ? AND "clark_kent_reports"."sharing_scope_type" = ? LIMIT 1 [["sharing_scope_id", 1], ["sharing_scope_type", "Department"]]
26554
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" IS NULL
26555
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" IS NULL
26556
+ Completed 200 OK in 20ms (Views: 19.3ms | ActiveRecord: 0.8ms)
26557
+ -----------------------------------------------------
26558
+ ClarkKent::ReportsControllerTest: test_should_get_new
26559
+ -----------------------------------------------------
26560
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26561
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
26562
+ Processing by ClarkKent::ReportsController#new as HTML
26563
+ Parameters: {"current_user_id"=>"1"}
26564
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
26565
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
26566
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_edit.html.erb (36.9ms)
26567
+ Completed 200 OK in 44ms (Views: 43.1ms | ActiveRecord: 0.3ms)
26568
+ ---------------------------------------------------------
26569
+ ClarkKent::ReportsControllerTest: test_should_show_report
26570
+ ---------------------------------------------------------
26571
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26572
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
26573
+ Processing by ClarkKent::ReportsController#show as HTML
26574
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
26575
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = 1 ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26576
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" IN (1) ORDER BY clark_kent_report_columns.column_order
26577
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26578
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26579
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26580
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.8ms)
26581
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
26582
+ User Load (0.1ms) SELECT "users".* FROM "users"
26583
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (1.7ms)
26584
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.4ms)
26585
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (0.4ms)
26586
+ Completed 200 OK in 24ms (Views: 18.7ms | ActiveRecord: 1.0ms)
26587
+ -----------------------------------------------------------------
26588
+ ClarkKent::ReportsControllerTest: test_should_show_report_results
26589
+ -----------------------------------------------------------------
26590
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26591
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
26592
+ Processing by ClarkKent::ReportsController#show as HTML
26593
+ Parameters: {"current_user_id"=>"1", "run_report"=>true, "created_at_until"=>"2015-10-05", "created_at_from"=>"2015-10-04", "id"=>"1"}
26594
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = 1 ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26595
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" IN (1) ORDER BY clark_kent_report_columns.column_order
26596
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26597
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
26598
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26599
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26600
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26601
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.3ms)
26602
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
26603
+ User Load (0.2ms) SELECT "users".* FROM "users"
26604
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (1.2ms)
26605
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.1ms)
26606
+  (0.2ms) SELECT COUNT(*) FROM "orders" WHERE (orders.user_id > 0)
26607
+  (0.2ms) SELECT COUNT(count_column) FROM (SELECT "orders"."id" AS count_column FROM "orders" WHERE (orders.user_id > 0) LIMIT 10 OFFSET 0) subquery_for_count
26608
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (6.4ms)
26609
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
26610
+ Order Load (0.1ms) SELECT DISTINCT orders.id, orders.user_id, orders.amount, orders.description, orders.created_at, orders.updated_at,
26611
+ (SELECT u.name
26612
+ FROM users u
26613
+ WHERE u.id = orders.user_id)
26614
+ as user_name FROM "orders" WHERE (orders.user_id > 0) LIMIT 10 OFFSET 0
26615
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
26616
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
26617
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
26618
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
26619
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_download_link.html.erb (0.9ms)
26620
+ Completed 200 OK in 9475ms (Views: 24.0ms | ActiveRecord: 1.9ms)
26621
+ --------------------------------------------------------------------
26622
+ ClarkKent::ReportsControllerTest: test_should_show_report_run_errors
26623
+ --------------------------------------------------------------------
26624
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26625
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
26626
+ Processing by ClarkKent::ReportsController#show as HTML
26627
+ Parameters: {"current_user_id"=>"1", "run_report"=>true, "id"=>"1"}
26628
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = 1 ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26629
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" IN (1) ORDER BY clark_kent_report_columns.column_order
26630
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26631
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
26632
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26633
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26634
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26635
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.6ms)
26636
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
26637
+ User Load (0.1ms) SELECT "users".* FROM "users"
26638
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (1.8ms)
26639
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.1ms)
26640
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (0.2ms)
26641
+ Completed 200 OK in 9286ms (Views: 10.6ms | ActiveRecord: 1.1ms)
26642
+ -----------------------------------------------------------
26643
+ ClarkKent::ReportsControllerTest: test_should_update_report
26644
+ -----------------------------------------------------------
26645
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26646
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
26647
+ Processing by ClarkKent::ReportsController#update as HTML
26648
+ Parameters: {"report"=>{"name"=>nil, "resource_type"=>"Order", "sharing_scope_id"=>nil, "sharing_scope_type"=>nil}, "current_user_id"=>"1", "id"=>"1"}
26649
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
26650
+  (0.0ms) begin transaction
26651
+  (0.0ms) commit transaction
26652
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (1.4ms)
26653
+ Completed 200 OK in 4ms (Views: 1.8ms | ActiveRecord: 0.2ms)
26654
+ ---------------------------------------------------
26655
+ ClarkKent::ReportEmailTest: test_sends_report_to_s3
26656
+ ---------------------------------------------------
26657
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
26658
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26659
+ SQL (1.5ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
26660
+  (0.1ms) begin transaction
26661
+ SQL (0.6ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
26662
+  (0.7ms) commit transaction
26663
+  (0.1ms) begin transaction
26664
+ SQL (0.4ms) INSERT INTO "clark_kent_report_filters" ("created_at", "duration", "filter_name", "filterable_id", "filterable_type", "kind_of_day", "offset", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-10-05 16:55:28.258634"], ["duration", "week"], ["filter_name", "created_at"], ["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"], ["kind_of_day", "Monday"], ["offset", "this_week"], ["type", "ClarkKent::ReportDateFilter"], ["updated_at", "2015-10-05 16:55:28.258634"]]
26665
+  (0.7ms) commit transaction
26666
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
26667
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
26668
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26669
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
26670
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
26671
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
26672
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26673
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
26674
+ -----------------------------------------------------------------------------------------
26675
+ ClarkKent::ReportEmailTest: test_throws_an_error_if_required_date_filters_are_not_present
26676
+ -----------------------------------------------------------------------------------------
26677
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
26678
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26679
+ SQL (1.8ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
26680
+  (0.1ms) begin transaction
26681
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
26682
+  (0.6ms) commit transaction
26683
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
26684
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
26685
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26686
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
26687
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 2]]
26688
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 2]]
26689
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 2], ["filterable_type", "ClarkKent::Report"]]
26690
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 2]]
26691
+  (2.1ms) CREATE TABLE "clark_kent_report_columns" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "column_name" varchar(255), "column_order" integer, "report_sort" varchar(255), "summary_method" varchar(255)) 
26692
+  (0.1ms) select sqlite_version(*)
26693
+  (0.9ms) CREATE INDEX "index_clark_kent_report_columns_on_report_id" ON "clark_kent_report_columns" ("report_id")
26694
+  (0.8ms) CREATE TABLE "clark_kent_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "when_to_send" varchar(255), "name" varchar(255))
26695
+  (0.8ms) CREATE TABLE "clark_kent_report_filters" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "filterable_id" integer, "filterable_type" varchar(255) DEFAULT 'ClarkKent::Report', "string" varchar(255) DEFAULT 'ClarkKent::Report', "filter_name" varchar(255), "filter_value" varchar(255), "type" varchar(255), "duration" varchar(255), "kind_of_day" varchar(255), "offset" varchar(255), "created_at" datetime, "updated_at" datetime) 
26696
+  (0.8ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_id" ON "clark_kent_report_filters" ("filterable_id")
26697
+  (0.1ms)  SELECT sql
26698
+ FROM sqlite_master
26699
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
26700
+ UNION ALL
26701
+ SELECT sql
26702
+ FROM sqlite_temp_master
26703
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
26704
+ 
26705
+  (0.8ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_type" ON "clark_kent_report_filters" ("filterable_type")
26706
+  (0.9ms) CREATE TABLE "clark_kent_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "resource_type" varchar(255), "sharing_scope_type" varchar(255), "sharing_scope_id" integer, "created_at" datetime, "updated_at" datetime) 
26707
+  (1.0ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_id" ON "clark_kent_reports" ("sharing_scope_id")
26708
+  (0.1ms)  SELECT sql
26709
+ FROM sqlite_master
26710
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
26711
+ UNION ALL
26712
+ SELECT sql
26713
+ FROM sqlite_temp_master
26714
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
26715
+ 
26716
+  (0.8ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_type" ON "clark_kent_reports" ("sharing_scope_type")
26717
+  (1.2ms) CREATE TABLE "clark_kent_user_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "report_email_id" integer) 
26718
+  (0.8ms) CREATE TABLE "departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255))
26719
+  (0.8ms) CREATE TABLE "orders" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "amount" integer, "description" varchar(255), "created_at" datetime, "updated_at" datetime) 
26720
+  (0.8ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "email" varchar(255), "age" integer, "department_id" integer)
26721
+  (1.0ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
26722
+  (1.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
26723
+  (0.1ms) SELECT version FROM "schema_migrations"
26724
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150313144015')
26725
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170042')
26726
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170112')
26727
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140114010048')
26728
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140129051754')
26729
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150304233739')
26730
+  (0.1ms) begin transaction
26731
+ SQL (0.3ms) INSERT INTO "clark_kent_reports" ("created_at", "resource_type", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-05 16:56:41.371535"], ["resource_type", "Order"], ["updated_at", "2015-10-05 16:56:41.371535"]]
26732
+  (1.1ms) commit transaction
26733
+  (0.1ms) begin transaction
26734
+ SQL (0.4ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "user_name"], ["column_order", 1], ["report_id", 1]]
26735
+  (0.9ms) commit transaction
26736
+  (0.1ms) begin transaction
26737
+ SQL (0.2ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "id"], ["column_order", 2], ["report_id", 1]]
26738
+  (0.8ms) commit transaction
26739
+  (0.0ms) begin transaction
26740
+ SQL (0.2ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "amount"], ["column_order", 3], ["report_id", 1]]
26741
+  (0.8ms) commit transaction
26742
+  (0.0ms) begin transaction
26743
+ SQL (0.2ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "description"], ["column_order", 4], ["report_id", 1]]
26744
+  (0.8ms) commit transaction
26745
+  (0.0ms) begin transaction
26746
+ SQL (0.3ms) INSERT INTO "departments" ("name") VALUES (?) [["name", "silly walks"]]
26747
+  (0.7ms) commit transaction
26748
+  (0.0ms) begin transaction
26749
+ SQL (0.3ms) INSERT INTO "users" ("department_id", "email", "name") VALUES (?, ?, ?) [["department_id", 1], ["email", "taproot@gmail.com"], ["name", "Michael Hedges"]]
26750
+  (0.7ms) commit transaction
26751
+  (0.1ms) begin transaction
26752
+ SQL (0.3ms) INSERT INTO "orders" ("amount", "created_at", "description", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["amount", 1], ["created_at", "2015-10-05 16:56:41.423738"], ["description", "Guitar strings"], ["updated_at", "2015-10-05 16:56:41.423738"], ["user_id", 1]]
26753
+  (1.1ms) commit transaction
26754
+ ---------------------------------------------------
26755
+ ClarkKent::ReportEmailTest: test_sends_report_to_s3
26756
+ ---------------------------------------------------
26757
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
26758
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26759
+ SQL (1.1ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
26760
+  (0.0ms) begin transaction
26761
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
26762
+  (0.8ms) commit transaction
26763
+  (0.1ms) begin transaction
26764
+ SQL (0.4ms) INSERT INTO "clark_kent_report_filters" ("created_at", "duration", "filter_name", "filterable_id", "filterable_type", "kind_of_day", "offset", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-10-05 16:56:41.500820"], ["duration", "week"], ["filter_name", "created_at"], ["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"], ["kind_of_day", "Monday"], ["offset", "this_week"], ["type", "ClarkKent::ReportDateFilter"], ["updated_at", "2015-10-05 16:56:41.500820"]]
26765
+  (0.7ms) commit transaction
26766
+ ClarkKent::ReportFilter Load (0.3ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"]]
26767
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
26768
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
26769
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26770
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
26771
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
26772
+ Department Load (0.2ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
26773
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
26774
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
26775
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26776
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
26777
+ -----------------------------------------------------------------------------------------
26778
+ ClarkKent::ReportEmailTest: test_throws_an_error_if_required_date_filters_are_not_present
26779
+ -----------------------------------------------------------------------------------------
26780
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
26781
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26782
+ SQL (1.6ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
26783
+  (0.1ms) begin transaction
26784
+ SQL (0.2ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
26785
+  (0.7ms) commit transaction
26786
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
26787
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
26788
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26789
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
26790
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 2]]
26791
+ -------------------------------------------------------------------
26792
+ ClarkKent::ReportableTest: test_it_adds_required_filters_if_present
26793
+ -------------------------------------------------------------------
26794
+  (0.1ms) begin transaction
26795
+ SQL (0.3ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-10-05 17:15:40.004601"], ["name", "test one"], ["resource_type", "Order"], ["updated_at", "2015-10-05 17:15:40.004601"]]
26796
+  (0.9ms) commit transaction
26797
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 2]]
26798
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 2], ["filterable_type", "ClarkKent::Report"]]
26799
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 2]]
26800
+ ---------------------------------------------------------------------
26801
+ ClarkKent::ReportableTest: test_it_works_without_any_required_filters
26802
+ ---------------------------------------------------------------------
26803
+  (0.1ms) begin transaction
26804
+ SQL (0.3ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-10-05 17:15:40.009760"], ["name", "test one"], ["resource_type", "TestReportable"], ["updated_at", "2015-10-05 17:15:40.009760"]]
26805
+  (0.7ms) commit transaction
26806
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 3]]
26807
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 3], ["filterable_type", "ClarkKent::Report"]]
26808
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 3]]
26809
+ -------------------------
26810
+ ClarkKentTest: test_truth
26811
+ -------------------------
26812
+ ------------------------------------------------------------------------------------------------
26813
+ ClarkKent::ReportTest: test_can't_save_without_a_sharing_scope_id_if_the_sharing_scope_is_custom
26814
+ ------------------------------------------------------------------------------------------------
26815
+  (0.1ms) begin transaction
26816
+  (0.1ms) rollback transaction
26817
+ -----------------------------------------------------------
26818
+ ClarkKent::ReportsControllerTest: test_should_create_report
26819
+ -----------------------------------------------------------
26820
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26821
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
26822
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
26823
+ Processing by ClarkKent::ReportsController#create as HTML
26824
+ Parameters: {"report"=>{"name"=>"delete me", "resource_type"=>"Order", "sharing_scope_id"=>"1", "sharing_scope_type"=>"Department"}, "current_user_id"=>"1"}
26825
+  (0.1ms) begin transaction
26826
+ SQL (0.4ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "sharing_scope_id", "sharing_scope_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-10-05 17:15:40.057166"], ["name", "delete me"], ["resource_type", "Order"], ["sharing_scope_id", 1], ["sharing_scope_type", "Department"], ["updated_at", "2015-10-05 17:15:40.057166"]]
26827
+  (1.0ms) commit transaction
26828
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
26829
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (3.2ms)
26830
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 4], ["filterable_type", "ClarkKent::Report"]]
26831
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_index.html.erb (2.0ms)
26832
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 4]]
26833
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_index.html.erb (1.4ms)
26834
+ ClarkKent::ReportEmail Load (0.1ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 4]]
26835
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_index.html.erb (1.4ms)
26836
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/edit.html.erb within layouts/application (20.0ms)
26837
+ Completed 200 OK in 153ms (Views: 149.5ms | ActiveRecord: 1.8ms)
26838
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
26839
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."name" = 'delete me' LIMIT 1
26840
+  (0.0ms) begin transaction
26841
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 4], ["filterable_type", "ClarkKent::Report"]]
26842
+ ClarkKent::ReportColumn Load (0.0ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 4]]
26843
+ ClarkKent::ReportEmail Load (0.0ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 4]]
26844
+ SQL (0.2ms) DELETE FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? [["id", 4]]
26845
+  (1.3ms) commit transaction
26846
+ ------------------------------------------------------------
26847
+ ClarkKent::ReportsControllerTest: test_should_destroy_report
26848
+ ------------------------------------------------------------
26849
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26850
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
26851
+  (0.0ms) begin transaction
26852
+ SQL (0.2ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-10-05 17:15:40.216969"], ["name", "delete me"], ["resource_type", "Order"], ["updated_at", "2015-10-05 17:15:40.216969"]]
26853
+  (1.0ms) commit transaction
26854
+  (0.2ms) SELECT COUNT(*) FROM "clark_kent_reports"
26855
+ Processing by ClarkKent::ReportsController#destroy as HTML
26856
+ Parameters: {"current_user_id"=>"1", "id"=>"5"}
26857
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 5]]
26858
+  (0.0ms) begin transaction
26859
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 5], ["filterable_type", "ClarkKent::Report"]]
26860
+ ClarkKent::ReportColumn Load (0.0ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 5]]
26861
+ ClarkKent::ReportEmail Load (0.0ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 5]]
26862
+ SQL (0.2ms) DELETE FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? [["id", 5]]
26863
+  (0.6ms) commit transaction
26864
+ Redirected to http://test.host/reports/reports
26865
+ Completed 302 Found in 5ms (ActiveRecord: 1.1ms)
26866
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
26867
+ ------------------------------------------------------
26868
+ ClarkKent::ReportsControllerTest: test_should_get_edit
26869
+ ------------------------------------------------------
26870
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26871
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
26872
+ Processing by ClarkKent::ReportsController#edit as HTML
26873
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
26874
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
26875
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
26876
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (1.4ms)
26877
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26878
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_index.html.erb (1.1ms)
26879
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
26880
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (1.0ms)
26881
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (3.4ms)
26882
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.4ms)
26883
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.6ms)
26884
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.3ms)
26885
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.5ms)
26886
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.4ms)
26887
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.5ms)
26888
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_index.html.erb (8.8ms)
26889
+ ClarkKent::ReportEmail Load (0.1ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 1]]
26890
+ ClarkKent::ReportDateFilter Load (0.2ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."type" IN ('ClarkKent::ReportDateFilter') AND "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"]]
26891
+ User Load (0.3ms) SELECT "users".* FROM "users" INNER JOIN "clark_kent_user_report_emails" ON "users"."id" = "clark_kent_user_report_emails"."user_id" WHERE "clark_kent_user_report_emails"."report_email_id" = ? [["report_email_id", 1]]
26892
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show.html.erb (17.3ms)
26893
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show_wrapper.html.erb (19.9ms)
26894
+ ClarkKent::ReportDateFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."type" IN ('ClarkKent::ReportDateFilter') AND "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 2], ["filterable_type", "ClarkKent::ReportEmail"]]
26895
+ User Load (0.1ms) SELECT "users".* FROM "users" INNER JOIN "clark_kent_user_report_emails" ON "users"."id" = "clark_kent_user_report_emails"."user_id" WHERE "clark_kent_user_report_emails"."report_email_id" = ? [["report_email_id", 2]]
26896
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show.html.erb (2.7ms)
26897
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show_wrapper.html.erb (3.2ms)
26898
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_index.html.erb (27.3ms)
26899
+ Completed 200 OK in 42ms (Views: 40.4ms | ActiveRecord: 1.2ms)
26900
+ -------------------------------------------------------
26901
+ ClarkKent::ReportsControllerTest: test_should_get_index
26902
+ -------------------------------------------------------
26903
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26904
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
26905
+ Processing by ClarkKent::ReportsController#index as HTML
26906
+ Parameters: {"current_user_id"=>"1"}
26907
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
26908
+ ClarkKent::Report Exists (0.1ms) SELECT 1 AS one FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" = ? AND "clark_kent_reports"."sharing_scope_type" = ? LIMIT 1 [["sharing_scope_id", 1], ["sharing_scope_type", "User"]]
26909
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
26910
+ ClarkKent::Report Exists (0.1ms) SELECT 1 AS one FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" = ? AND "clark_kent_reports"."sharing_scope_type" = ? LIMIT 1 [["sharing_scope_id", 1], ["sharing_scope_type", "Department"]]
26911
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" = ? AND "clark_kent_reports"."sharing_scope_type" = ? [["sharing_scope_id", 1], ["sharing_scope_type", "Department"]]
26912
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" IS NULL
26913
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" IS NULL
26914
+ Completed 200 OK in 13ms (Views: 12.2ms | ActiveRecord: 0.7ms)
26915
+ -----------------------------------------------------
26916
+ ClarkKent::ReportsControllerTest: test_should_get_new
26917
+ -----------------------------------------------------
26918
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26919
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
26920
+ Processing by ClarkKent::ReportsController#new as HTML
26921
+ Parameters: {"current_user_id"=>"1"}
26922
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
26923
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
26924
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_edit.html.erb (38.9ms)
26925
+ Completed 200 OK in 48ms (Views: 47.3ms | ActiveRecord: 0.2ms)
26926
+ ---------------------------------------------------------
26927
+ ClarkKent::ReportsControllerTest: test_should_show_report
26928
+ ---------------------------------------------------------
26929
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26930
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
26931
+ Processing by ClarkKent::ReportsController#show as HTML
26932
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
26933
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = 1 ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26934
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" IN (1) ORDER BY clark_kent_report_columns.column_order
26935
+  (0.2ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26936
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26937
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26938
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (1.2ms)
26939
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
26940
+ User Load (0.1ms) SELECT "users".* FROM "users"
26941
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (2.2ms)
26942
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.6ms)
26943
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (0.7ms)
26944
+ Completed 200 OK in 33ms (Views: 25.2ms | ActiveRecord: 0.9ms)
26945
+ -----------------------------------------------------------------
26946
+ ClarkKent::ReportsControllerTest: test_should_show_report_results
26947
+ -----------------------------------------------------------------
26948
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26949
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
26950
+ Processing by ClarkKent::ReportsController#show as HTML
26951
+ Parameters: {"current_user_id"=>"1", "run_report"=>true, "created_at_until"=>"2015-10-05", "created_at_from"=>"2015-10-04", "id"=>"1"}
26952
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = 1 ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26953
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" IN (1) ORDER BY clark_kent_report_columns.column_order
26954
+ ClarkKent::ReportFilter Load (0.2ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26955
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
26956
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26957
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26958
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26959
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.3ms)
26960
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
26961
+ User Load (0.1ms) SELECT "users".* FROM "users"
26962
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (2.0ms)
26963
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.1ms)
26964
+  (0.1ms) SELECT COUNT(*) FROM "orders" WHERE (orders.user_id > 0)
26965
+  (0.2ms) SELECT COUNT(count_column) FROM (SELECT "orders"."id" AS count_column FROM "orders" WHERE (orders.user_id > 0) LIMIT 10 OFFSET 0) subquery_for_count
26966
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (9.0ms)
26967
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
26968
+ Order Load (0.2ms) SELECT DISTINCT orders.id, orders.user_id, orders.amount, orders.description, orders.created_at, orders.updated_at,
26969
+ (SELECT u.name
26970
+ FROM users u
26971
+ WHERE u.id = orders.user_id)
26972
+ as user_name FROM "orders" WHERE (orders.user_id > 0) LIMIT 10 OFFSET 0
26973
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
26974
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
26975
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
26976
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
26977
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_download_link.html.erb (1.1ms)
26978
+ Completed 200 OK in 40ms (Views: 30.5ms | ActiveRecord: 2.2ms)
26979
+ --------------------------------------------------------------------
26980
+ ClarkKent::ReportsControllerTest: test_should_show_report_run_errors
26981
+ --------------------------------------------------------------------
26982
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26983
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
26984
+ Processing by ClarkKent::ReportsController#show as HTML
26985
+ Parameters: {"current_user_id"=>"1", "run_report"=>true, "id"=>"1"}
26986
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = 1 ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
26987
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" IN (1) ORDER BY clark_kent_report_columns.column_order
26988
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26989
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
26990
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26991
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26992
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
26993
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.4ms)
26994
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
26995
+ User Load (0.1ms) SELECT "users".* FROM "users"
26996
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (1.2ms)
26997
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.1ms)
26998
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (0.0ms)
26999
+ Completed 200 OK in 12ms (Views: 6.8ms | ActiveRecord: 0.8ms)
27000
+ -----------------------------------------------------------
27001
+ ClarkKent::ReportsControllerTest: test_should_update_report
27002
+ -----------------------------------------------------------
27003
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
27004
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
27005
+ Processing by ClarkKent::ReportsController#update as HTML
27006
+ Parameters: {"report"=>{"name"=>nil, "resource_type"=>"Order", "sharing_scope_id"=>"1", "sharing_scope_type"=>"Department"}, "current_user_id"=>"1", "id"=>"1"}
27007
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
27008
+  (0.0ms) begin transaction
27009
+  (0.0ms) commit transaction
27010
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
27011
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (1.7ms)
27012
+ Completed 200 OK in 4ms (Views: 2.0ms | ActiveRecord: 0.3ms)
27013
+  (2.0ms) CREATE TABLE "clark_kent_report_columns" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "column_name" varchar(255), "column_order" integer, "report_sort" varchar(255), "summary_method" varchar(255)) 
27014
+  (0.1ms) select sqlite_version(*)
27015
+  (1.0ms) CREATE INDEX "index_clark_kent_report_columns_on_report_id" ON "clark_kent_report_columns" ("report_id")
27016
+  (0.9ms) CREATE TABLE "clark_kent_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "when_to_send" varchar(255), "name" varchar(255))
27017
+  (0.9ms) CREATE TABLE "clark_kent_report_filters" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "filterable_id" integer, "filterable_type" varchar(255) DEFAULT 'ClarkKent::Report', "string" varchar(255) DEFAULT 'ClarkKent::Report', "filter_name" varchar(255), "filter_value" varchar(255), "type" varchar(255), "duration" varchar(255), "kind_of_day" varchar(255), "offset" varchar(255), "created_at" datetime, "updated_at" datetime) 
27018
+  (0.9ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_id" ON "clark_kent_report_filters" ("filterable_id")
27019
+  (0.1ms)  SELECT sql
27020
+ FROM sqlite_master
27021
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
27022
+ UNION ALL
27023
+ SELECT sql
27024
+ FROM sqlite_temp_master
27025
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
27026
+ 
27027
+  (0.9ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_type" ON "clark_kent_report_filters" ("filterable_type")
27028
+  (1.0ms) CREATE TABLE "clark_kent_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "resource_type" varchar(255), "sharing_scope_type" varchar(255), "sharing_scope_id" integer, "created_at" datetime, "updated_at" datetime) 
27029
+  (0.9ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_id" ON "clark_kent_reports" ("sharing_scope_id")
27030
+  (0.1ms)  SELECT sql
27031
+ FROM sqlite_master
27032
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
27033
+ UNION ALL
27034
+ SELECT sql
27035
+ FROM sqlite_temp_master
27036
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
27037
+ 
27038
+  (0.8ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_type" ON "clark_kent_reports" ("sharing_scope_type")
27039
+  (0.9ms) CREATE TABLE "clark_kent_user_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "report_email_id" integer) 
27040
+  (0.8ms) CREATE TABLE "departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255))
27041
+  (0.8ms) CREATE TABLE "orders" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "amount" integer, "description" varchar(255), "created_at" datetime, "updated_at" datetime) 
27042
+  (0.8ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "email" varchar(255), "age" integer, "department_id" integer)
27043
+  (1.0ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
27044
+  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
27045
+  (0.1ms) SELECT version FROM "schema_migrations"
27046
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20150313144015')
27047
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170042')
27048
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170112')
27049
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140114010048')
27050
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140129051754')
27051
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150304233739')
27052
+  (0.0ms) begin transaction
27053
+ SQL (0.4ms) INSERT INTO "clark_kent_reports" ("created_at", "resource_type", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-05 17:21:56.928266"], ["resource_type", "Order"], ["updated_at", "2015-10-05 17:21:56.928266"]]
27054
+  (1.1ms) commit transaction
27055
+  (0.1ms) begin transaction
27056
+ SQL (0.3ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "user_name"], ["column_order", 1], ["report_id", 1]]
27057
+  (0.9ms) commit transaction
27058
+  (0.1ms) begin transaction
27059
+ SQL (0.3ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "id"], ["column_order", 2], ["report_id", 1]]
27060
+  (0.9ms) commit transaction
27061
+  (0.1ms) begin transaction
27062
+ SQL (0.2ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "amount"], ["column_order", 3], ["report_id", 1]]
27063
+  (0.7ms) commit transaction
27064
+  (0.1ms) begin transaction
27065
+ SQL (0.2ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "description"], ["column_order", 4], ["report_id", 1]]
27066
+  (0.8ms) commit transaction
27067
+  (0.0ms) begin transaction
27068
+ SQL (0.3ms) INSERT INTO "departments" ("name") VALUES (?) [["name", "silly walks"]]
27069
+  (0.7ms) commit transaction
27070
+  (0.1ms) begin transaction
27071
+ SQL (0.3ms) INSERT INTO "users" ("department_id", "email", "name") VALUES (?, ?, ?) [["department_id", 1], ["email", "taproot@gmail.com"], ["name", "Michael Hedges"]]
27072
+  (0.9ms) commit transaction
27073
+  (0.1ms) begin transaction
27074
+ SQL (0.3ms) INSERT INTO "orders" ("amount", "created_at", "description", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["amount", 1], ["created_at", "2015-10-05 17:21:56.979330"], ["description", "Guitar strings"], ["updated_at", "2015-10-05 17:21:56.979330"], ["user_id", 1]]
27075
+  (0.9ms) commit transaction
27076
+ ---------------------------------------------------
27077
+ ClarkKent::ReportEmailTest: test_sends_report_to_s3
27078
+ ---------------------------------------------------
27079
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
27080
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
27081
+ SQL (1.2ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
27082
+  (0.0ms) begin transaction
27083
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
27084
+  (0.9ms) commit transaction
27085
+  (0.0ms) begin transaction
27086
+ SQL (0.4ms) INSERT INTO "clark_kent_report_filters" ("created_at", "duration", "filter_name", "filterable_id", "filterable_type", "kind_of_day", "offset", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-10-05 17:21:57.036962"], ["duration", "week"], ["filter_name", "created_at"], ["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"], ["kind_of_day", "Monday"], ["offset", "this_week"], ["type", "ClarkKent::ReportDateFilter"], ["updated_at", "2015-10-05 17:21:57.036962"]]
27087
+  (0.9ms) commit transaction
27088
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
27089
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
27090
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
27091
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
27092
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
27093
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
27094
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
27095
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
27096
+ -----------------------------------------------------------------------------------------
27097
+ ClarkKent::ReportEmailTest: test_throws_an_error_if_required_date_filters_are_not_present
27098
+ -----------------------------------------------------------------------------------------
27099
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
27100
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
27101
+ SQL (1.6ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
27102
+  (0.1ms) begin transaction
27103
+ SQL (0.2ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
27104
+  (0.7ms) commit transaction
27105
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
27106
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
27107
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
27108
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
27109
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 2]]
27110
+  (1.8ms) CREATE TABLE "clark_kent_report_columns" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "column_name" varchar(255), "column_order" integer, "report_sort" varchar(255), "summary_method" varchar(255)) 
27111
+  (0.1ms) select sqlite_version(*)
27112
+  (0.9ms) CREATE INDEX "index_clark_kent_report_columns_on_report_id" ON "clark_kent_report_columns" ("report_id")
27113
+  (0.8ms) CREATE TABLE "clark_kent_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "when_to_send" varchar(255), "name" varchar(255))
27114
+  (0.8ms) CREATE TABLE "clark_kent_report_filters" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "filterable_id" integer, "filterable_type" varchar(255) DEFAULT 'ClarkKent::Report', "string" varchar(255) DEFAULT 'ClarkKent::Report', "filter_name" varchar(255), "filter_value" varchar(255), "type" varchar(255), "duration" varchar(255), "kind_of_day" varchar(255), "offset" varchar(255), "created_at" datetime, "updated_at" datetime) 
27115
+  (0.7ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_id" ON "clark_kent_report_filters" ("filterable_id")
27116
+  (0.1ms)  SELECT sql
27117
+ FROM sqlite_master
27118
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
27119
+ UNION ALL
27120
+ SELECT sql
27121
+ FROM sqlite_temp_master
27122
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
27123
+ 
27124
+  (0.8ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_type" ON "clark_kent_report_filters" ("filterable_type")
27125
+  (1.0ms) CREATE TABLE "clark_kent_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "resource_type" varchar(255), "sharing_scope_type" varchar(255), "sharing_scope_id" integer, "created_at" datetime, "updated_at" datetime) 
27126
+  (0.9ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_id" ON "clark_kent_reports" ("sharing_scope_id")
27127
+  (0.1ms)  SELECT sql
27128
+ FROM sqlite_master
27129
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
27130
+ UNION ALL
27131
+ SELECT sql
27132
+ FROM sqlite_temp_master
27133
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
27134
+ 
27135
+  (0.8ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_type" ON "clark_kent_reports" ("sharing_scope_type")
27136
+  (0.7ms) CREATE TABLE "clark_kent_user_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "report_email_id" integer) 
27137
+  (0.8ms) CREATE TABLE "departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255))
27138
+  (0.7ms) CREATE TABLE "orders" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "amount" integer, "description" varchar(255), "created_at" datetime, "updated_at" datetime) 
27139
+  (0.9ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "email" varchar(255), "age" integer, "department_id" integer)
27140
+  (0.9ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
27141
+  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
27142
+  (0.1ms) SELECT version FROM "schema_migrations"
27143
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150313144015')
27144
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170042')
27145
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170112')
27146
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140114010048')
27147
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140129051754')
27148
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20150304233739')
27149
+  (0.1ms) begin transaction
27150
+ SQL (0.4ms) INSERT INTO "clark_kent_reports" ("created_at", "resource_type", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-05 17:22:30.688619"], ["resource_type", "Order"], ["updated_at", "2015-10-05 17:22:30.688619"]]
27151
+  (0.7ms) commit transaction
27152
+  (0.0ms) begin transaction
27153
+ SQL (0.3ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "user_name"], ["column_order", 1], ["report_id", 1]]
27154
+  (0.9ms) commit transaction
27155
+  (0.1ms) begin transaction
27156
+ SQL (0.3ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "id"], ["column_order", 2], ["report_id", 1]]
27157
+  (0.7ms) commit transaction
27158
+  (0.0ms) begin transaction
27159
+ SQL (0.2ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "amount"], ["column_order", 3], ["report_id", 1]]
27160
+  (0.8ms) commit transaction
27161
+  (0.1ms) begin transaction
27162
+ SQL (0.2ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "description"], ["column_order", 4], ["report_id", 1]]
27163
+  (0.7ms) commit transaction
27164
+  (0.1ms) begin transaction
27165
+ SQL (0.3ms) INSERT INTO "departments" ("name") VALUES (?) [["name", "silly walks"]]
27166
+  (0.6ms) commit transaction
27167
+  (0.0ms) begin transaction
27168
+ SQL (0.4ms) INSERT INTO "users" ("department_id", "email", "name") VALUES (?, ?, ?) [["department_id", 1], ["email", "taproot@gmail.com"], ["name", "Michael Hedges"]]
27169
+  (0.8ms) commit transaction
27170
+  (0.1ms) begin transaction
27171
+ SQL (0.4ms) INSERT INTO "orders" ("amount", "created_at", "description", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["amount", 1], ["created_at", "2015-10-05 17:22:30.736233"], ["description", "Guitar strings"], ["updated_at", "2015-10-05 17:22:30.736233"], ["user_id", 1]]
27172
+  (0.9ms) commit transaction
27173
+ ---------------------------------------------------
27174
+ ClarkKent::ReportEmailTest: test_sends_report_to_s3
27175
+ ---------------------------------------------------
27176
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
27177
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
27178
+ SQL (1.1ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
27179
+  (0.0ms) begin transaction
27180
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
27181
+  (0.8ms) commit transaction
27182
+  (0.0ms) begin transaction
27183
+ SQL (0.6ms) INSERT INTO "clark_kent_report_filters" ("created_at", "duration", "filter_name", "filterable_id", "filterable_type", "kind_of_day", "offset", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-10-05 17:22:30.791789"], ["duration", "week"], ["filter_name", "created_at"], ["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"], ["kind_of_day", "Monday"], ["offset", "this_week"], ["type", "ClarkKent::ReportDateFilter"], ["updated_at", "2015-10-05 17:22:30.791789"]]
27184
+  (1.1ms) commit transaction
27185
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
27186
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
27187
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
27188
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
27189
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
27190
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
27191
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
27192
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
27193
+ -----------------------------------------------------------------------------------------
27194
+ ClarkKent::ReportEmailTest: test_throws_an_error_if_required_date_filters_are_not_present
27195
+ -----------------------------------------------------------------------------------------
27196
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
27197
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
27198
+ SQL (1.3ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
27199
+  (0.1ms) begin transaction
27200
+ SQL (0.2ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
27201
+  (2.1ms) commit transaction
27202
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
27203
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
27204
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
27205
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
27206
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 2]]
27207
+  (1.7ms) CREATE TABLE "clark_kent_report_columns" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "column_name" varchar(255), "column_order" integer, "report_sort" varchar(255), "summary_method" varchar(255)) 
27208
+  (0.1ms) select sqlite_version(*)
27209
+  (0.9ms) CREATE INDEX "index_clark_kent_report_columns_on_report_id" ON "clark_kent_report_columns" ("report_id")
27210
+  (0.8ms) CREATE TABLE "clark_kent_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "when_to_send" varchar(255), "name" varchar(255))
27211
+  (0.8ms) CREATE TABLE "clark_kent_report_filters" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "filterable_id" integer, "filterable_type" varchar(255) DEFAULT 'ClarkKent::Report', "string" varchar(255) DEFAULT 'ClarkKent::Report', "filter_name" varchar(255), "filter_value" varchar(255), "type" varchar(255), "duration" varchar(255), "kind_of_day" varchar(255), "offset" varchar(255), "created_at" datetime, "updated_at" datetime) 
27212
+  (0.7ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_id" ON "clark_kent_report_filters" ("filterable_id")
27213
+  (0.1ms)  SELECT sql
27214
+ FROM sqlite_master
27215
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
27216
+ UNION ALL
27217
+ SELECT sql
27218
+ FROM sqlite_temp_master
27219
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
27220
+ 
27221
+  (0.8ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_type" ON "clark_kent_report_filters" ("filterable_type")
27222
+  (0.9ms) CREATE TABLE "clark_kent_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "resource_type" varchar(255), "sharing_scope_type" varchar(255), "sharing_scope_id" integer, "created_at" datetime, "updated_at" datetime) 
27223
+  (0.9ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_id" ON "clark_kent_reports" ("sharing_scope_id")
27224
+  (0.1ms)  SELECT sql
27225
+ FROM sqlite_master
27226
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
27227
+ UNION ALL
27228
+ SELECT sql
27229
+ FROM sqlite_temp_master
27230
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
27231
+ 
27232
+  (0.8ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_type" ON "clark_kent_reports" ("sharing_scope_type")
27233
+  (0.7ms) CREATE TABLE "clark_kent_user_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "report_email_id" integer) 
27234
+  (0.8ms) CREATE TABLE "departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255))
27235
+  (0.8ms) CREATE TABLE "orders" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "amount" integer, "description" varchar(255), "created_at" datetime, "updated_at" datetime) 
27236
+  (0.8ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "email" varchar(255), "age" integer, "department_id" integer)
27237
+  (1.0ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
27238
+  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
27239
+  (0.1ms) SELECT version FROM "schema_migrations"
27240
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150313144015')
27241
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170042')
27242
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170112')
27243
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140114010048')
27244
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140129051754')
27245
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150304233739')
27246
+  (0.1ms) begin transaction
27247
+ SQL (0.4ms) INSERT INTO "clark_kent_reports" ("created_at", "resource_type", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-05 17:24:05.514959"], ["resource_type", "Order"], ["updated_at", "2015-10-05 17:24:05.514959"]]
27248
+  (1.1ms) commit transaction
27249
+  (0.1ms) begin transaction
27250
+ SQL (0.4ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "user_name"], ["column_order", 1], ["report_id", 1]]
27251
+  (0.9ms) commit transaction
27252
+  (0.1ms) begin transaction
27253
+ SQL (0.3ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "id"], ["column_order", 2], ["report_id", 1]]
27254
+  (0.9ms) commit transaction
27255
+  (0.1ms) begin transaction
27256
+ SQL (0.2ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "amount"], ["column_order", 3], ["report_id", 1]]
27257
+  (0.7ms) commit transaction
27258
+  (0.0ms) begin transaction
27259
+ SQL (0.2ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "description"], ["column_order", 4], ["report_id", 1]]
27260
+  (0.7ms) commit transaction
27261
+  (0.0ms) begin transaction
27262
+ SQL (0.3ms) INSERT INTO "departments" ("name") VALUES (?) [["name", "silly walks"]]
27263
+  (0.7ms) commit transaction
27264
+  (0.0ms) begin transaction
27265
+ SQL (0.3ms) INSERT INTO "users" ("department_id", "email", "name") VALUES (?, ?, ?) [["department_id", 1], ["email", "taproot@gmail.com"], ["name", "Michael Hedges"]]
27266
+  (0.9ms) commit transaction
27267
+  (0.1ms) begin transaction
27268
+ SQL (0.4ms) INSERT INTO "orders" ("amount", "created_at", "description", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["amount", 1], ["created_at", "2015-10-05 17:24:05.569224"], ["description", "Guitar strings"], ["updated_at", "2015-10-05 17:24:05.569224"], ["user_id", 1]]
27269
+  (0.7ms) commit transaction
27270
+ ---------------------------------------------------
27271
+ ClarkKent::ReportEmailTest: test_sends_report_to_s3
27272
+ ---------------------------------------------------
27273
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
27274
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
27275
+ SQL (0.9ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
27276
+  (0.0ms) begin transaction
27277
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
27278
+  (0.7ms) commit transaction
27279
+  (0.1ms) begin transaction
27280
+ SQL (0.4ms) INSERT INTO "clark_kent_report_filters" ("created_at", "duration", "filter_name", "filterable_id", "filterable_type", "kind_of_day", "offset", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-10-05 17:24:05.621234"], ["duration", "week"], ["filter_name", "created_at"], ["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"], ["kind_of_day", "Monday"], ["offset", "this_week"], ["type", "ClarkKent::ReportDateFilter"], ["updated_at", "2015-10-05 17:24:05.621234"]]
27281
+  (1.0ms) commit transaction
27282
+ User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
27283
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
27284
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
27285
+ Department Load (0.2ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
27286
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
27287
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
27288
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
27289
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
27290
+ -----------------------------------------------------------------------------------------
27291
+ ClarkKent::ReportEmailTest: test_throws_an_error_if_required_date_filters_are_not_present
27292
+ -----------------------------------------------------------------------------------------
27293
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
27294
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
27295
+ SQL (1.5ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
27296
+  (0.2ms) begin transaction
27297
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
27298
+  (0.7ms) commit transaction
27299
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
27300
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
27301
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
27302
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
27303
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 2]]
27304
+  (1.8ms) CREATE TABLE "clark_kent_report_columns" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "column_name" varchar(255), "column_order" integer, "report_sort" varchar(255), "summary_method" varchar(255)) 
27305
+  (0.1ms) select sqlite_version(*)
27306
+  (1.2ms) CREATE INDEX "index_clark_kent_report_columns_on_report_id" ON "clark_kent_report_columns" ("report_id")
27307
+  (0.9ms) CREATE TABLE "clark_kent_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "when_to_send" varchar(255), "name" varchar(255))
27308
+  (0.9ms) CREATE TABLE "clark_kent_report_filters" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "filterable_id" integer, "filterable_type" varchar(255) DEFAULT 'ClarkKent::Report', "string" varchar(255) DEFAULT 'ClarkKent::Report', "filter_name" varchar(255), "filter_value" varchar(255), "type" varchar(255), "duration" varchar(255), "kind_of_day" varchar(255), "offset" varchar(255), "created_at" datetime, "updated_at" datetime) 
27309
+  (0.8ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_id" ON "clark_kent_report_filters" ("filterable_id")
27310
+  (0.1ms)  SELECT sql
27311
+ FROM sqlite_master
27312
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
27313
+ UNION ALL
27314
+ SELECT sql
27315
+ FROM sqlite_temp_master
27316
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
27317
+ 
27318
+  (0.8ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_type" ON "clark_kent_report_filters" ("filterable_type")
27319
+  (0.8ms) CREATE TABLE "clark_kent_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "resource_type" varchar(255), "sharing_scope_type" varchar(255), "sharing_scope_id" integer, "created_at" datetime, "updated_at" datetime) 
27320
+  (0.9ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_id" ON "clark_kent_reports" ("sharing_scope_id")
27321
+  (0.1ms)  SELECT sql
27322
+ FROM sqlite_master
27323
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
27324
+ UNION ALL
27325
+ SELECT sql
27326
+ FROM sqlite_temp_master
27327
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
27328
+ 
27329
+  (0.8ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_type" ON "clark_kent_reports" ("sharing_scope_type")
27330
+  (0.9ms) CREATE TABLE "clark_kent_user_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "report_email_id" integer) 
27331
+  (0.9ms) CREATE TABLE "departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255))
27332
+  (0.8ms) CREATE TABLE "orders" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "amount" integer, "description" varchar(255), "created_at" datetime, "updated_at" datetime) 
27333
+  (0.8ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "email" varchar(255), "age" integer, "department_id" integer)
27334
+  (1.2ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
27335
+  (1.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
27336
+  (0.1ms) SELECT version FROM "schema_migrations"
27337
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150313144015')
27338
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170042')
27339
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170112')
27340
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140114010048')
27341
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140129051754')
27342
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150304233739')
27343
+  (0.1ms) begin transaction
27344
+ SQL (0.4ms) INSERT INTO "clark_kent_reports" ("created_at", "resource_type", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-05 17:24:55.470202"], ["resource_type", "Order"], ["updated_at", "2015-10-05 17:24:55.470202"]]
27345
+  (1.0ms) commit transaction
27346
+  (0.1ms) begin transaction
27347
+ SQL (0.3ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "user_name"], ["column_order", 1], ["report_id", 1]]
27348
+  (1.0ms) commit transaction
27349
+  (0.1ms) begin transaction
27350
+ SQL (0.3ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "id"], ["column_order", 2], ["report_id", 1]]
27351
+  (0.9ms) commit transaction
27352
+  (0.1ms) begin transaction
27353
+ SQL (0.2ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "amount"], ["column_order", 3], ["report_id", 1]]
27354
+  (0.8ms) commit transaction
27355
+  (0.0ms) begin transaction
27356
+ SQL (0.2ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "description"], ["column_order", 4], ["report_id", 1]]
27357
+  (0.6ms) commit transaction
27358
+  (0.0ms) begin transaction
27359
+ SQL (0.3ms) INSERT INTO "departments" ("name") VALUES (?) [["name", "silly walks"]]
27360
+  (0.9ms) commit transaction
27361
+  (0.0ms) begin transaction
27362
+ SQL (0.3ms) INSERT INTO "users" ("department_id", "email", "name") VALUES (?, ?, ?) [["department_id", 1], ["email", "taproot@gmail.com"], ["name", "Michael Hedges"]]
27363
+  (0.8ms) commit transaction
27364
+  (0.1ms) begin transaction
27365
+ SQL (0.3ms) INSERT INTO "orders" ("amount", "created_at", "description", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["amount", 1], ["created_at", "2015-10-05 17:24:55.521794"], ["description", "Guitar strings"], ["updated_at", "2015-10-05 17:24:55.521794"], ["user_id", 1]]
27366
+  (0.9ms) commit transaction
27367
+ ---------------------------------------------------
27368
+ ClarkKent::ReportEmailTest: test_sends_report_to_s3
27369
+ ---------------------------------------------------
27370
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
27371
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
27372
+ SQL (1.1ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
27373
+  (0.0ms) begin transaction
27374
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
27375
+  (0.7ms) commit transaction
27376
+  (0.1ms) begin transaction
27377
+ SQL (0.4ms) INSERT INTO "clark_kent_report_filters" ("created_at", "duration", "filter_name", "filterable_id", "filterable_type", "kind_of_day", "offset", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-10-05 17:24:55.578451"], ["duration", "week"], ["filter_name", "created_at"], ["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"], ["kind_of_day", "Monday"], ["offset", "this_week"], ["type", "ClarkKent::ReportDateFilter"], ["updated_at", "2015-10-05 17:24:55.578451"]]
27378
+  (1.0ms) commit transaction
27379
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
27380
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
27381
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
27382
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
27383
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
27384
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
27385
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
27386
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
27387
+ -----------------------------------------------------------------------------------------
27388
+ ClarkKent::ReportEmailTest: test_throws_an_error_if_required_date_filters_are_not_present
27389
+ -----------------------------------------------------------------------------------------
27390
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
27391
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
27392
+ SQL (0.9ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
27393
+  (0.1ms) begin transaction
27394
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
27395
+  (0.7ms) commit transaction
27396
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
27397
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
27398
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
27399
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
27400
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 2]]
27401
+  (1.9ms) CREATE TABLE "clark_kent_report_columns" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "column_name" varchar(255), "column_order" integer, "report_sort" varchar(255), "summary_method" varchar(255)) 
27402
+  (0.1ms) select sqlite_version(*)
27403
+  (1.0ms) CREATE INDEX "index_clark_kent_report_columns_on_report_id" ON "clark_kent_report_columns" ("report_id")
27404
+  (0.9ms) CREATE TABLE "clark_kent_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "when_to_send" varchar(255), "name" varchar(255))
27405
+  (0.8ms) CREATE TABLE "clark_kent_report_filters" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "filterable_id" integer, "filterable_type" varchar(255) DEFAULT 'ClarkKent::Report', "string" varchar(255) DEFAULT 'ClarkKent::Report', "filter_name" varchar(255), "filter_value" varchar(255), "type" varchar(255), "duration" varchar(255), "kind_of_day" varchar(255), "offset" varchar(255), "created_at" datetime, "updated_at" datetime) 
27406
+  (0.8ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_id" ON "clark_kent_report_filters" ("filterable_id")
27407
+  (0.1ms)  SELECT sql
27408
+ FROM sqlite_master
27409
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
27410
+ UNION ALL
27411
+ SELECT sql
27412
+ FROM sqlite_temp_master
27413
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
27414
+ 
27415
+  (0.8ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_type" ON "clark_kent_report_filters" ("filterable_type")
27416
+  (0.8ms) CREATE TABLE "clark_kent_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "resource_type" varchar(255), "sharing_scope_type" varchar(255), "sharing_scope_id" integer, "created_at" datetime, "updated_at" datetime) 
27417
+  (0.8ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_id" ON "clark_kent_reports" ("sharing_scope_id")
27418
+  (0.1ms)  SELECT sql
27419
+ FROM sqlite_master
27420
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
27421
+ UNION ALL
27422
+ SELECT sql
27423
+ FROM sqlite_temp_master
27424
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
27425
+ 
27426
+  (0.9ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_type" ON "clark_kent_reports" ("sharing_scope_type")
27427
+  (0.8ms) CREATE TABLE "clark_kent_user_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "report_email_id" integer) 
27428
+  (0.8ms) CREATE TABLE "departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255))
27429
+  (0.9ms) CREATE TABLE "orders" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "amount" integer, "description" varchar(255), "created_at" datetime, "updated_at" datetime) 
27430
+  (0.8ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "email" varchar(255), "age" integer, "department_id" integer)
27431
+  (0.9ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
27432
+  (0.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
27433
+  (0.1ms) SELECT version FROM "schema_migrations"
27434
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20150313144015')
27435
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170042')
27436
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170112')
27437
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140114010048')
27438
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140129051754')
27439
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150304233739')
27440
+  (0.0ms) begin transaction
27441
+ SQL (0.4ms) INSERT INTO "clark_kent_reports" ("created_at", "resource_type", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-05 17:26:25.766586"], ["resource_type", "Order"], ["updated_at", "2015-10-05 17:26:25.766586"]]
27442
+  (1.1ms) commit transaction
27443
+  (0.0ms) begin transaction
27444
+ SQL (0.3ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "user_name"], ["column_order", 1], ["report_id", 1]]
27445
+  (0.9ms) commit transaction
27446
+  (0.0ms) begin transaction
27447
+ SQL (0.4ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "id"], ["column_order", 2], ["report_id", 1]]
27448
+  (0.7ms) commit transaction
27449
+  (0.0ms) begin transaction
27450
+ SQL (0.2ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "amount"], ["column_order", 3], ["report_id", 1]]
27451
+  (0.6ms) commit transaction
27452
+  (0.1ms) begin transaction
27453
+ SQL (0.2ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "description"], ["column_order", 4], ["report_id", 1]]
27454
+  (0.7ms) commit transaction
27455
+  (0.1ms) begin transaction
27456
+ SQL (0.3ms) INSERT INTO "departments" ("name") VALUES (?) [["name", "silly walks"]]
27457
+  (0.7ms) commit transaction
27458
+  (0.1ms) begin transaction
27459
+ SQL (0.3ms) INSERT INTO "users" ("department_id", "email", "name") VALUES (?, ?, ?) [["department_id", 1], ["email", "taproot@gmail.com"], ["name", "Michael Hedges"]]
27460
+  (0.9ms) commit transaction
27461
+  (0.1ms) begin transaction
27462
+ SQL (0.3ms) INSERT INTO "orders" ("amount", "created_at", "description", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["amount", 1], ["created_at", "2015-10-05 17:26:25.816929"], ["description", "Guitar strings"], ["updated_at", "2015-10-05 17:26:25.816929"], ["user_id", 1]]
27463
+  (0.9ms) commit transaction
27464
+ ---------------------------------------------------
27465
+ ClarkKent::ReportEmailTest: test_sends_report_to_s3
27466
+ ---------------------------------------------------
27467
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
27468
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
27469
+ SQL (1.2ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
27470
+  (0.1ms) begin transaction
27471
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
27472
+  (0.7ms) commit transaction
27473
+  (0.0ms) begin transaction
27474
+ SQL (0.4ms) INSERT INTO "clark_kent_report_filters" ("created_at", "duration", "filter_name", "filterable_id", "filterable_type", "kind_of_day", "offset", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-10-05 17:26:25.874139"], ["duration", "week"], ["filter_name", "created_at"], ["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"], ["kind_of_day", "Monday"], ["offset", "this_week"], ["type", "ClarkKent::ReportDateFilter"], ["updated_at", "2015-10-05 17:26:25.874139"]]
27475
+  (0.7ms) commit transaction
27476
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
27477
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
27478
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
27479
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
27480
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
27481
+ ClarkKent::ReportColumn Load (0.3ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
27482
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
27483
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
27484
+  (1.8ms) CREATE TABLE "clark_kent_report_columns" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "column_name" varchar(255), "column_order" integer, "report_sort" varchar(255), "summary_method" varchar(255)) 
27485
+  (0.1ms) select sqlite_version(*)
27486
+  (1.0ms) CREATE INDEX "index_clark_kent_report_columns_on_report_id" ON "clark_kent_report_columns" ("report_id")
27487
+  (0.8ms) CREATE TABLE "clark_kent_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "when_to_send" varchar(255), "name" varchar(255))
27488
+  (1.1ms) CREATE TABLE "clark_kent_report_filters" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "filterable_id" integer, "filterable_type" varchar(255) DEFAULT 'ClarkKent::Report', "string" varchar(255) DEFAULT 'ClarkKent::Report', "filter_name" varchar(255), "filter_value" varchar(255), "type" varchar(255), "duration" varchar(255), "kind_of_day" varchar(255), "offset" varchar(255), "created_at" datetime, "updated_at" datetime) 
27489
+  (0.8ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_id" ON "clark_kent_report_filters" ("filterable_id")
27490
+  (0.1ms)  SELECT sql
27491
+ FROM sqlite_master
27492
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
27493
+ UNION ALL
27494
+ SELECT sql
27495
+ FROM sqlite_temp_master
27496
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
27497
+ 
27498
+  (1.0ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_type" ON "clark_kent_report_filters" ("filterable_type")
27499
+  (0.9ms) CREATE TABLE "clark_kent_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "resource_type" varchar(255), "sharing_scope_type" varchar(255), "sharing_scope_id" integer, "created_at" datetime, "updated_at" datetime) 
27500
+  (1.0ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_id" ON "clark_kent_reports" ("sharing_scope_id")
27501
+  (0.1ms)  SELECT sql
27502
+ FROM sqlite_master
27503
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
27504
+ UNION ALL
27505
+ SELECT sql
27506
+ FROM sqlite_temp_master
27507
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
27508
+ 
27509
+  (0.9ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_type" ON "clark_kent_reports" ("sharing_scope_type")
27510
+  (1.0ms) CREATE TABLE "clark_kent_user_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "report_email_id" integer) 
27511
+  (0.8ms) CREATE TABLE "departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255))
27512
+  (0.8ms) CREATE TABLE "orders" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "amount" integer, "description" varchar(255), "created_at" datetime, "updated_at" datetime) 
27513
+  (0.9ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "email" varchar(255), "age" integer, "department_id" integer)
27514
+  (1.2ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
27515
+  (1.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
27516
+  (0.1ms) SELECT version FROM "schema_migrations"
27517
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20150313144015')
27518
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170042')
27519
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170112')
27520
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140114010048')
27521
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140129051754')
27522
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150304233739')
27523
+  (0.0ms) begin transaction
27524
+ SQL (0.4ms) INSERT INTO "clark_kent_reports" ("created_at", "resource_type", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-05 17:28:28.583722"], ["resource_type", "Order"], ["updated_at", "2015-10-05 17:28:28.583722"]]
27525
+  (1.2ms) commit transaction
27526
+  (0.0ms) begin transaction
27527
+ SQL (0.4ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "user_name"], ["column_order", 1], ["report_id", 1]]
27528
+  (0.9ms) commit transaction
27529
+  (0.1ms) begin transaction
27530
+ SQL (0.3ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "id"], ["column_order", 2], ["report_id", 1]]
27531
+  (0.9ms) commit transaction
27532
+  (0.0ms) begin transaction
27533
+ SQL (0.2ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "amount"], ["column_order", 3], ["report_id", 1]]
27534
+  (0.7ms) commit transaction
27535
+  (0.1ms) begin transaction
27536
+ SQL (0.3ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "description"], ["column_order", 4], ["report_id", 1]]
27537
+  (0.7ms) commit transaction
27538
+  (0.1ms) begin transaction
27539
+ SQL (0.3ms) INSERT INTO "departments" ("name") VALUES (?) [["name", "silly walks"]]
27540
+  (0.8ms) commit transaction
27541
+  (0.1ms) begin transaction
27542
+ SQL (0.3ms) INSERT INTO "users" ("department_id", "email", "name") VALUES (?, ?, ?) [["department_id", 1], ["email", "taproot@gmail.com"], ["name", "Michael Hedges"]]
27543
+  (0.7ms) commit transaction
27544
+  (0.1ms) begin transaction
27545
+ SQL (0.3ms) INSERT INTO "orders" ("amount", "created_at", "description", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["amount", 1], ["created_at", "2015-10-05 17:28:28.634590"], ["description", "Guitar strings"], ["updated_at", "2015-10-05 17:28:28.634590"], ["user_id", 1]]
27546
+  (0.9ms) commit transaction
27547
+ ---------------------------------------------------
27548
+ ClarkKent::ReportEmailTest: test_sends_report_to_s3
27549
+ ---------------------------------------------------
27550
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
27551
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
27552
+ SQL (1.2ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
27553
+  (0.0ms) begin transaction
27554
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
27555
+  (0.9ms) commit transaction
27556
+  (0.0ms) begin transaction
27557
+ SQL (0.4ms) INSERT INTO "clark_kent_report_filters" ("created_at", "duration", "filter_name", "filterable_id", "filterable_type", "kind_of_day", "offset", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-10-05 17:28:28.694614"], ["duration", "week"], ["filter_name", "created_at"], ["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"], ["kind_of_day", "Monday"], ["offset", "this_week"], ["type", "ClarkKent::ReportDateFilter"], ["updated_at", "2015-10-05 17:28:28.694614"]]
27558
+  (1.0ms) commit transaction
27559
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
27560
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
27561
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
27562
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
27563
+ ClarkKent::ReportEmail Load (0.4ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."id" = ? LIMIT 1 [["id", 1]]
27564
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
27565
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
27566
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
27567
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"]]
27568
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
27569
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
27570
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
27571
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
27572
+  (0.1ms) SELECT COUNT(*) FROM "orders" WHERE (orders.user_id > 0)
27573
+  (1.9ms) CREATE TABLE "clark_kent_report_columns" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "column_name" varchar(255), "column_order" integer, "report_sort" varchar(255), "summary_method" varchar(255)) 
27574
+  (0.1ms) select sqlite_version(*)
27575
+  (1.0ms) CREATE INDEX "index_clark_kent_report_columns_on_report_id" ON "clark_kent_report_columns" ("report_id")
27576
+  (0.8ms) CREATE TABLE "clark_kent_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "when_to_send" varchar(255), "name" varchar(255))
27577
+  (0.9ms) CREATE TABLE "clark_kent_report_filters" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "filterable_id" integer, "filterable_type" varchar(255) DEFAULT 'ClarkKent::Report', "string" varchar(255) DEFAULT 'ClarkKent::Report', "filter_name" varchar(255), "filter_value" varchar(255), "type" varchar(255), "duration" varchar(255), "kind_of_day" varchar(255), "offset" varchar(255), "created_at" datetime, "updated_at" datetime) 
27578
+  (0.9ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_id" ON "clark_kent_report_filters" ("filterable_id")
27579
+  (0.1ms)  SELECT sql
27580
+ FROM sqlite_master
27581
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
27582
+ UNION ALL
27583
+ SELECT sql
27584
+ FROM sqlite_temp_master
27585
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
27586
+ 
27587
+  (0.8ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_type" ON "clark_kent_report_filters" ("filterable_type")
27588
+  (1.1ms) CREATE TABLE "clark_kent_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "resource_type" varchar(255), "sharing_scope_type" varchar(255), "sharing_scope_id" integer, "created_at" datetime, "updated_at" datetime) 
27589
+  (0.9ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_id" ON "clark_kent_reports" ("sharing_scope_id")
27590
+  (0.1ms)  SELECT sql
27591
+ FROM sqlite_master
27592
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
27593
+ UNION ALL
27594
+ SELECT sql
27595
+ FROM sqlite_temp_master
27596
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
27597
+ 
27598
+  (0.8ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_type" ON "clark_kent_reports" ("sharing_scope_type")
27599
+  (0.9ms) CREATE TABLE "clark_kent_user_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "report_email_id" integer) 
27600
+  (0.9ms) CREATE TABLE "departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255))
27601
+  (0.8ms) CREATE TABLE "orders" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "amount" integer, "description" varchar(255), "created_at" datetime, "updated_at" datetime) 
27602
+  (0.9ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "email" varchar(255), "age" integer, "department_id" integer)
27603
+  (1.0ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
27604
+  (0.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
27605
+  (0.1ms) SELECT version FROM "schema_migrations"
27606
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20150313144015')
27607
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170042')
27608
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170112')
27609
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140114010048')
27610
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140129051754')
27611
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150304233739')
27612
+  (0.1ms) begin transaction
27613
+ SQL (0.4ms) INSERT INTO "clark_kent_reports" ("created_at", "resource_type", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-05 17:29:07.642234"], ["resource_type", "Order"], ["updated_at", "2015-10-05 17:29:07.642234"]]
27614
+  (0.8ms) commit transaction
27615
+  (0.1ms) begin transaction
27616
+ SQL (0.3ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "user_name"], ["column_order", 1], ["report_id", 1]]
27617
+  (0.7ms) commit transaction
27618
+  (0.1ms) begin transaction
27619
+ SQL (0.2ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "id"], ["column_order", 2], ["report_id", 1]]
27620
+  (0.7ms) commit transaction
27621
+  (0.0ms) begin transaction
27622
+ SQL (0.2ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "amount"], ["column_order", 3], ["report_id", 1]]
27623
+  (0.7ms) commit transaction
27624
+  (0.0ms) begin transaction
27625
+ SQL (0.2ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "description"], ["column_order", 4], ["report_id", 1]]
27626
+  (0.7ms) commit transaction
27627
+  (0.1ms) begin transaction
27628
+ SQL (0.3ms) INSERT INTO "departments" ("name") VALUES (?) [["name", "silly walks"]]
27629
+  (0.7ms) commit transaction
27630
+  (0.1ms) begin transaction
27631
+ SQL (0.3ms) INSERT INTO "users" ("department_id", "email", "name") VALUES (?, ?, ?) [["department_id", 1], ["email", "taproot@gmail.com"], ["name", "Michael Hedges"]]
27632
+  (0.9ms) commit transaction
27633
+  (0.1ms) begin transaction
27634
+ SQL (0.4ms) INSERT INTO "orders" ("amount", "created_at", "description", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["amount", 1], ["created_at", "2015-10-05 17:29:07.692457"], ["description", "Guitar strings"], ["updated_at", "2015-10-05 17:29:07.692457"], ["user_id", 1]]
27635
+  (0.9ms) commit transaction
27636
+ ---------------------------------------------------
27637
+ ClarkKent::ReportEmailTest: test_sends_report_to_s3
27638
+ ---------------------------------------------------
27639
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
27640
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
27641
+ SQL (1.3ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
27642
+  (0.0ms) begin transaction
27643
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
27644
+  (1.0ms) commit transaction
27645
+  (0.0ms) begin transaction
27646
+ SQL (0.4ms) INSERT INTO "clark_kent_report_filters" ("created_at", "duration", "filter_name", "filterable_id", "filterable_type", "kind_of_day", "offset", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-10-05 17:29:07.752473"], ["duration", "week"], ["filter_name", "created_at"], ["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"], ["kind_of_day", "Monday"], ["offset", "this_week"], ["type", "ClarkKent::ReportDateFilter"], ["updated_at", "2015-10-05 17:29:07.752473"]]
27647
+  (0.8ms) commit transaction
27648
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
27649
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
27650
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
27651
+ Department Load (0.2ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
27652
+ ClarkKent::ReportEmail Load (0.3ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."id" = ? LIMIT 1 [["id", 1]]
27653
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
27654
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
27655
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
27656
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"]]
27657
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
27658
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
27659
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
27660
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
27661
+  (0.1ms) SELECT COUNT(*) FROM "orders" WHERE (orders.user_id > 0)
27662
+  (1.8ms) CREATE TABLE "clark_kent_report_columns" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "column_name" varchar(255), "column_order" integer, "report_sort" varchar(255), "summary_method" varchar(255)) 
27663
+  (0.1ms) select sqlite_version(*)
27664
+  (1.2ms) CREATE INDEX "index_clark_kent_report_columns_on_report_id" ON "clark_kent_report_columns" ("report_id")
27665
+  (1.2ms) CREATE TABLE "clark_kent_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "when_to_send" varchar(255), "name" varchar(255))
27666
+  (1.1ms) CREATE TABLE "clark_kent_report_filters" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "filterable_id" integer, "filterable_type" varchar(255) DEFAULT 'ClarkKent::Report', "string" varchar(255) DEFAULT 'ClarkKent::Report', "filter_name" varchar(255), "filter_value" varchar(255), "type" varchar(255), "duration" varchar(255), "kind_of_day" varchar(255), "offset" varchar(255), "created_at" datetime, "updated_at" datetime) 
27667
+  (0.9ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_id" ON "clark_kent_report_filters" ("filterable_id")
27668
+  (0.1ms)  SELECT sql
27669
+ FROM sqlite_master
27670
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
27671
+ UNION ALL
27672
+ SELECT sql
27673
+ FROM sqlite_temp_master
27674
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
27675
+ 
27676
+  (0.9ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_type" ON "clark_kent_report_filters" ("filterable_type")
27677
+  (0.9ms) CREATE TABLE "clark_kent_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "resource_type" varchar(255), "sharing_scope_type" varchar(255), "sharing_scope_id" integer, "created_at" datetime, "updated_at" datetime) 
27678
+  (0.8ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_id" ON "clark_kent_reports" ("sharing_scope_id")
27679
+  (0.1ms)  SELECT sql
27680
+ FROM sqlite_master
27681
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
27682
+ UNION ALL
27683
+ SELECT sql
27684
+ FROM sqlite_temp_master
27685
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
27686
+ 
27687
+  (0.9ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_type" ON "clark_kent_reports" ("sharing_scope_type")
27688
+  (0.9ms) CREATE TABLE "clark_kent_user_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "report_email_id" integer) 
27689
+  (0.9ms) CREATE TABLE "departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255))
27690
+  (0.9ms) CREATE TABLE "orders" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "amount" integer, "description" varchar(255), "created_at" datetime, "updated_at" datetime) 
27691
+  (1.0ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "email" varchar(255), "age" integer, "department_id" integer)
27692
+  (1.0ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
27693
+  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
27694
+  (0.1ms) SELECT version FROM "schema_migrations"
27695
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150313144015')
27696
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170042')
27697
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170112')
27698
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140114010048')
27699
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140129051754')
27700
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20150304233739')
27701
+  (0.1ms) begin transaction
27702
+ SQL (0.4ms) INSERT INTO "clark_kent_reports" ("created_at", "resource_type", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-05 17:29:24.568307"], ["resource_type", "Order"], ["updated_at", "2015-10-05 17:29:24.568307"]]
27703
+  (0.8ms) commit transaction
27704
+  (0.1ms) begin transaction
27705
+ SQL (0.5ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "user_name"], ["column_order", 1], ["report_id", 1]]
27706
+  (0.8ms) commit transaction
27707
+  (0.1ms) begin transaction
27708
+ SQL (0.3ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "id"], ["column_order", 2], ["report_id", 1]]
27709
+  (0.6ms) commit transaction
27710
+  (0.1ms) begin transaction
27711
+ SQL (0.3ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "amount"], ["column_order", 3], ["report_id", 1]]
27712
+  (0.7ms) commit transaction
27713
+  (0.1ms) begin transaction
27714
+ SQL (0.3ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "description"], ["column_order", 4], ["report_id", 1]]
27715
+  (0.8ms) commit transaction
27716
+  (0.0ms) begin transaction
27717
+ SQL (0.3ms) INSERT INTO "departments" ("name") VALUES (?) [["name", "silly walks"]]
27718
+  (0.9ms) commit transaction
27719
+  (0.0ms) begin transaction
27720
+ SQL (0.3ms) INSERT INTO "users" ("department_id", "email", "name") VALUES (?, ?, ?) [["department_id", 1], ["email", "taproot@gmail.com"], ["name", "Michael Hedges"]]
27721
+  (1.0ms) commit transaction
27722
+  (0.1ms) begin transaction
27723
+ SQL (0.4ms) INSERT INTO "orders" ("amount", "created_at", "description", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["amount", 1], ["created_at", "2015-10-05 17:29:24.620188"], ["description", "Guitar strings"], ["updated_at", "2015-10-05 17:29:24.620188"], ["user_id", 1]]
27724
+  (0.9ms) commit transaction
27725
+ ---------------------------------------------------
27726
+ ClarkKent::ReportEmailTest: test_sends_report_to_s3
27727
+ ---------------------------------------------------
27728
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
27729
+ ClarkKent::Report Load (0.3ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
27730
+ SQL (1.1ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
27731
+  (0.0ms) begin transaction
27732
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
27733
+  (0.9ms) commit transaction
27734
+  (0.0ms) begin transaction
27735
+ SQL (0.4ms) INSERT INTO "clark_kent_report_filters" ("created_at", "duration", "filter_name", "filterable_id", "filterable_type", "kind_of_day", "offset", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-10-05 17:29:24.676625"], ["duration", "week"], ["filter_name", "created_at"], ["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"], ["kind_of_day", "Monday"], ["offset", "this_week"], ["type", "ClarkKent::ReportDateFilter"], ["updated_at", "2015-10-05 17:29:24.676625"]]
27736
+  (0.9ms) commit transaction
27737
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
27738
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
27739
+ ClarkKent::ReportFilter Load (0.2ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
27740
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
27741
+ ClarkKent::ReportEmail Load (0.3ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."id" = ? LIMIT 1 [["id", 1]]
27742
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
27743
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
27744
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
27745
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"]]
27746
+ ClarkKent::ReportColumn Load (0.3ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
27747
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
27748
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
27749
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
27750
+  (0.2ms) SELECT COUNT(*) FROM "orders" WHERE (orders.user_id > 0)
27751
+ -----------------------------------------------------------------------------------------
27752
+ ClarkKent::ReportEmailTest: test_throws_an_error_if_required_date_filters_are_not_present
27753
+ -----------------------------------------------------------------------------------------
27754
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
27755
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
27756
+ SQL (1.6ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
27757
+  (0.1ms) begin transaction
27758
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
27759
+  (0.6ms) commit transaction
27760
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
27761
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
27762
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
27763
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
27764
+ ClarkKent::ReportEmail Load (0.1ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."id" = ? LIMIT 1 [["id", 2]]
27765
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
27766
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
27767
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
27768
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 2], ["filterable_type", "ClarkKent::ReportEmail"]]
27769
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
27770
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
27771
+  (1.6ms) CREATE TABLE "clark_kent_report_columns" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "column_name" varchar(255), "column_order" integer, "report_sort" varchar(255), "summary_method" varchar(255)) 
27772
+  (0.1ms) select sqlite_version(*)
27773
+  (1.0ms) CREATE INDEX "index_clark_kent_report_columns_on_report_id" ON "clark_kent_report_columns" ("report_id")
27774
+  (0.8ms) CREATE TABLE "clark_kent_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "when_to_send" varchar(255), "name" varchar(255))
27775
+  (0.8ms) CREATE TABLE "clark_kent_report_filters" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "filterable_id" integer, "filterable_type" varchar(255) DEFAULT 'ClarkKent::Report', "string" varchar(255) DEFAULT 'ClarkKent::Report', "filter_name" varchar(255), "filter_value" varchar(255), "type" varchar(255), "duration" varchar(255), "kind_of_day" varchar(255), "offset" varchar(255), "created_at" datetime, "updated_at" datetime) 
27776
+  (0.8ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_id" ON "clark_kent_report_filters" ("filterable_id")
27777
+  (0.1ms)  SELECT sql
27778
+ FROM sqlite_master
27779
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
27780
+ UNION ALL
27781
+ SELECT sql
27782
+ FROM sqlite_temp_master
27783
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
27784
+ 
27785
+  (0.8ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_type" ON "clark_kent_report_filters" ("filterable_type")
27786
+  (0.9ms) CREATE TABLE "clark_kent_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "resource_type" varchar(255), "sharing_scope_type" varchar(255), "sharing_scope_id" integer, "created_at" datetime, "updated_at" datetime) 
27787
+  (0.8ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_id" ON "clark_kent_reports" ("sharing_scope_id")
27788
+  (0.1ms)  SELECT sql
27789
+ FROM sqlite_master
27790
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
27791
+ UNION ALL
27792
+ SELECT sql
27793
+ FROM sqlite_temp_master
27794
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
27795
+ 
27796
+  (0.8ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_type" ON "clark_kent_reports" ("sharing_scope_type")
27797
+  (0.8ms) CREATE TABLE "clark_kent_user_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "report_email_id" integer) 
27798
+  (0.8ms) CREATE TABLE "departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255))
27799
+  (0.8ms) CREATE TABLE "orders" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "amount" integer, "description" varchar(255), "created_at" datetime, "updated_at" datetime) 
27800
+  (0.8ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "email" varchar(255), "age" integer, "department_id" integer)
27801
+  (0.9ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
27802
+  (0.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
27803
+  (0.1ms) SELECT version FROM "schema_migrations"
27804
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20150313144015')
27805
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170042')
27806
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170112')
27807
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140114010048')
27808
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140129051754')
27809
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150304233739')
27810
+  (0.1ms) begin transaction
27811
+ SQL (0.6ms) INSERT INTO "clark_kent_reports" ("created_at", "resource_type", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-10-05 17:29:45.486161"], ["resource_type", "Order"], ["updated_at", "2015-10-05 17:29:45.486161"]]
27812
+  (1.0ms) commit transaction
27813
+  (0.1ms) begin transaction
27814
+ SQL (0.4ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "user_name"], ["column_order", 1], ["report_id", 1]]
27815
+  (1.0ms) commit transaction
27816
+  (0.1ms) begin transaction
27817
+ SQL (0.3ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "id"], ["column_order", 2], ["report_id", 1]]
27818
+  (0.9ms) commit transaction
27819
+  (0.1ms) begin transaction
27820
+ SQL (0.2ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "amount"], ["column_order", 3], ["report_id", 1]]
27821
+  (0.6ms) commit transaction
27822
+  (0.1ms) begin transaction
27823
+ SQL (0.2ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "description"], ["column_order", 4], ["report_id", 1]]
27824
+  (0.7ms) commit transaction
27825
+  (0.0ms) begin transaction
27826
+ SQL (0.3ms) INSERT INTO "departments" ("name") VALUES (?) [["name", "silly walks"]]
27827
+  (0.7ms) commit transaction
27828
+  (0.0ms) begin transaction
27829
+ SQL (0.3ms) INSERT INTO "users" ("department_id", "email", "name") VALUES (?, ?, ?) [["department_id", 1], ["email", "taproot@gmail.com"], ["name", "Michael Hedges"]]
27830
+  (0.9ms) commit transaction
27831
+  (0.1ms) begin transaction
27832
+ SQL (0.3ms) INSERT INTO "orders" ("amount", "created_at", "description", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["amount", 1], ["created_at", "2015-10-05 17:29:45.539773"], ["description", "Guitar strings"], ["updated_at", "2015-10-05 17:29:45.539773"], ["user_id", 1]]
27833
+  (0.9ms) commit transaction
27834
+ -----------------------------------------------------------
27835
+ ClarkKent::ReportsControllerTest: test_should_create_report
27836
+ -----------------------------------------------------------
27837
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
27838
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
27839
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
27840
+ Processing by ClarkKent::ReportsController#create as HTML
27841
+ Parameters: {"report"=>{"name"=>"delete me", "resource_type"=>"Order", "sharing_scope_id"=>nil, "sharing_scope_type"=>nil}, "current_user_id"=>"1"}
27842
+  (0.1ms) begin transaction
27843
+ SQL (0.3ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-10-05 17:29:45.609844"], ["name", "delete me"], ["resource_type", "Order"], ["updated_at", "2015-10-05 17:29:45.609844"]]
27844
+  (1.1ms) commit transaction
27845
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (4.9ms)
27846
+ ClarkKent::ReportFilter Load (0.2ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 2], ["filterable_type", "ClarkKent::Report"]]
27847
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_index.html.erb (5.1ms)
27848
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 2]]
27849
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_index.html.erb (1.8ms)
27850
+ ClarkKent::ReportEmail Load (0.1ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 2]]
27851
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_index.html.erb (7.2ms)
27852
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/edit.html.erb within layouts/application (32.4ms)
27853
+ Completed 200 OK in 171ms (Views: 167.2ms | ActiveRecord: 2.2ms)
27854
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
27855
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."name" = 'delete me' LIMIT 1
27856
+  (0.0ms) begin transaction
27857
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 2], ["filterable_type", "ClarkKent::Report"]]
27858
+ ClarkKent::ReportColumn Load (0.0ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 2]]
27859
+ ClarkKent::ReportEmail Load (0.0ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 2]]
27860
+ SQL (0.2ms) DELETE FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? [["id", 2]]
27861
+  (1.5ms) commit transaction
27862
+ ------------------------------------------------------------
27863
+ ClarkKent::ReportsControllerTest: test_should_destroy_report
27864
+ ------------------------------------------------------------
27865
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
27866
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
27867
+  (0.0ms) begin transaction
27868
+ SQL (0.3ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-10-05 17:29:45.789742"], ["name", "delete me"], ["resource_type", "Order"], ["updated_at", "2015-10-05 17:29:45.789742"]]
27869
+  (0.9ms) commit transaction
27870
+  (0.2ms) SELECT COUNT(*) FROM "clark_kent_reports"
27871
+ Processing by ClarkKent::ReportsController#destroy as HTML
27872
+ Parameters: {"current_user_id"=>"1", "id"=>"3"}
27873
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 3]]
27874
+  (0.0ms) begin transaction
27875
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 3], ["filterable_type", "ClarkKent::Report"]]
27876
+ ClarkKent::ReportColumn Load (0.0ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 3]]
27877
+ ClarkKent::ReportEmail Load (0.0ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 3]]
27878
+ SQL (0.2ms) DELETE FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? [["id", 3]]
27879
+  (0.7ms) commit transaction
27880
+ Redirected to http://test.host/reports/reports
27881
+ Completed 302 Found in 5ms (ActiveRecord: 1.3ms)
27882
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
27883
+ ------------------------------------------------------
27884
+ ClarkKent::ReportsControllerTest: test_should_get_edit
27885
+ ------------------------------------------------------
27886
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
27887
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
27888
+ Processing by ClarkKent::ReportsController#edit as HTML
27889
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
27890
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
27891
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (0.8ms)
27892
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
27893
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_index.html.erb (1.2ms)
27894
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
27895
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.7ms)
27896
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (3.1ms)
27897
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.3ms)
27898
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.4ms)
27899
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.2ms)
27900
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.4ms)
27901
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.2ms)
27902
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.4ms)
27903
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_index.html.erb (7.8ms)
27904
+ ClarkKent::ReportEmail Load (0.1ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 1]]
27905
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_index.html.erb (0.9ms)
27906
+ Completed 200 OK in 14ms (Views: 12.9ms | ActiveRecord: 0.4ms)
27907
+ -------------------------------------------------------
27908
+ ClarkKent::ReportsControllerTest: test_should_get_index
27909
+ -------------------------------------------------------
27910
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
27911
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
27912
+ Processing by ClarkKent::ReportsController#index as HTML
27913
+ Parameters: {"current_user_id"=>"1"}
27914
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
27915
+ ClarkKent::Report Exists (0.2ms) SELECT 1 AS one FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" = ? AND "clark_kent_reports"."sharing_scope_type" = ? LIMIT 1 [["sharing_scope_id", 1], ["sharing_scope_type", "User"]]
27916
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
27917
+ ClarkKent::Report Exists (0.1ms) SELECT 1 AS one FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" = ? AND "clark_kent_reports"."sharing_scope_type" = ? LIMIT 1 [["sharing_scope_id", 1], ["sharing_scope_type", "Department"]]
27918
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" IS NULL
27919
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" IS NULL
27920
+ Completed 200 OK in 20ms (Views: 19.3ms | ActiveRecord: 0.9ms)
27921
+ -----------------------------------------------------
27922
+ ClarkKent::ReportsControllerTest: test_should_get_new
27923
+ -----------------------------------------------------
27924
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
27925
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
27926
+ Processing by ClarkKent::ReportsController#new as HTML
27927
+ Parameters: {"current_user_id"=>"1"}
27928
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
27929
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
27930
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_edit.html.erb (40.1ms)
27931
+ Completed 200 OK in 47ms (Views: 46.3ms | ActiveRecord: 0.2ms)
27932
+ ---------------------------------------------------------
27933
+ ClarkKent::ReportsControllerTest: test_should_show_report
27934
+ ---------------------------------------------------------
27935
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
27936
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
27937
+ Processing by ClarkKent::ReportsController#show as HTML
27938
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
27939
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = 1 ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
27940
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" IN (1) ORDER BY clark_kent_report_columns.column_order
27941
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
27942
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
27943
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
27944
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.7ms)
27945
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
27946
+ User Load (0.1ms) SELECT "users".* FROM "users"
27947
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (19.0ms)
27948
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.5ms)
27949
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (0.5ms)
27950
+ Completed 200 OK in 41ms (Views: 36.3ms | ActiveRecord: 1.0ms)
27951
+ -----------------------------------------------------------------
27952
+ ClarkKent::ReportsControllerTest: test_should_show_report_results
27953
+ -----------------------------------------------------------------
27954
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
27955
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
27956
+ Processing by ClarkKent::ReportsController#show as HTML
27957
+ Parameters: {"current_user_id"=>"1", "run_report"=>true, "created_at_until"=>"2015-10-05", "created_at_from"=>"2015-10-04", "id"=>"1"}
27958
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = 1 ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
27959
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" IN (1) ORDER BY clark_kent_report_columns.column_order
27960
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
27961
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
27962
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
27963
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
27964
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
27965
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.4ms)
27966
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
27967
+ User Load (0.1ms) SELECT "users".* FROM "users"
27968
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (1.2ms)
27969
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.1ms)
27970
+  (0.1ms) SELECT COUNT(*) FROM "orders" WHERE (orders.user_id > 0)
27971
+  (0.2ms) SELECT COUNT(count_column) FROM (SELECT "orders"."id" AS count_column FROM "orders" WHERE (orders.user_id > 0) LIMIT 10 OFFSET 0) subquery_for_count
27972
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (4.6ms)
27973
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
27974
+ Order Load (0.2ms) SELECT DISTINCT orders.id, orders.user_id, orders.amount, orders.description, orders.created_at, orders.updated_at,
27975
+ (SELECT u.name
27976
+ FROM users u
27977
+ WHERE u.id = orders.user_id)
27978
+ as user_name FROM "orders" WHERE (orders.user_id > 0) LIMIT 10 OFFSET 0
27979
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
27980
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
27981
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
27982
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
27983
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_download_link.html.erb (1.1ms)
27984
+ Completed 200 OK in 28ms (Views: 22.4ms | ActiveRecord: 1.9ms)
27985
+ --------------------------------------------------------------------
27986
+ ClarkKent::ReportsControllerTest: test_should_show_report_run_errors
27987
+ --------------------------------------------------------------------
27988
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
27989
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
27990
+ Processing by ClarkKent::ReportsController#show as HTML
27991
+ Parameters: {"current_user_id"=>"1", "run_report"=>true, "id"=>"1"}
27992
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = 1 ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
27993
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" IN (1) ORDER BY clark_kent_report_columns.column_order
27994
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
27995
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
27996
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
27997
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
27998
+  (0.1ms) SELECT "clark_kent_report_filters"."filter_name" FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
27999
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.2ms)
28000
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
28001
+ User Load (0.1ms) SELECT "users".* FROM "users"
28002
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (1.0ms)
28003
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.1ms)
28004
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (0.0ms)
28005
+ Completed 200 OK in 11ms (Views: 5.8ms | ActiveRecord: 1.0ms)
28006
+ -----------------------------------------------------------
28007
+ ClarkKent::ReportsControllerTest: test_should_update_report
28008
+ -----------------------------------------------------------
28009
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
28010
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
28011
+ Processing by ClarkKent::ReportsController#update as HTML
28012
+ Parameters: {"report"=>{"name"=>nil, "resource_type"=>"Order", "sharing_scope_id"=>nil, "sharing_scope_type"=>nil}, "current_user_id"=>"1", "id"=>"1"}
28013
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
28014
+  (0.0ms) begin transaction
28015
+  (0.1ms) commit transaction
28016
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (1.6ms)
28017
+ Completed 200 OK in 4ms (Views: 2.0ms | ActiveRecord: 0.2ms)
28018
+ -------------------------------------------------------------------
28019
+ ClarkKent::ReportableTest: test_it_adds_required_filters_if_present
28020
+ -------------------------------------------------------------------
28021
+  (0.1ms) begin transaction
28022
+ SQL (0.4ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-10-05 17:29:45.989654"], ["name", "test one"], ["resource_type", "Order"], ["updated_at", "2015-10-05 17:29:45.989654"]]
28023
+  (1.4ms) commit transaction
28024
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 4]]
28025
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 4], ["filterable_type", "ClarkKent::Report"]]
28026
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 4]]
28027
+ ---------------------------------------------------------------------
28028
+ ClarkKent::ReportableTest: test_it_works_without_any_required_filters
28029
+ ---------------------------------------------------------------------
28030
+  (0.1ms) begin transaction
28031
+ SQL (0.3ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-10-05 17:29:45.996013"], ["name", "test one"], ["resource_type", "TestReportable"], ["updated_at", "2015-10-05 17:29:45.996013"]]
28032
+  (1.0ms) commit transaction
28033
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 5]]
28034
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 5], ["filterable_type", "ClarkKent::Report"]]
28035
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 5]]
28036
+ ------------------------------------------------------------------------------------------------
28037
+ ClarkKent::ReportTest: test_can't_save_without_a_sharing_scope_id_if_the_sharing_scope_is_custom
28038
+ ------------------------------------------------------------------------------------------------
28039
+  (0.1ms) begin transaction
28040
+  (0.0ms) rollback transaction
28041
+ -------------------------
28042
+ ClarkKentTest: test_truth
28043
+ -------------------------
28044
+ ---------------------------------------------------
28045
+ ClarkKent::ReportEmailTest: test_sends_report_to_s3
28046
+ ---------------------------------------------------
28047
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
28048
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
28049
+ SQL (1.2ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
28050
+  (0.1ms) begin transaction
28051
+ SQL (0.4ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
28052
+  (0.8ms) commit transaction
28053
+  (0.1ms) begin transaction
28054
+ SQL (0.4ms) INSERT INTO "clark_kent_report_filters" ("created_at", "duration", "filter_name", "filterable_id", "filterable_type", "kind_of_day", "offset", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2015-10-05 17:29:46.030462"], ["duration", "week"], ["filter_name", "created_at"], ["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"], ["kind_of_day", "Monday"], ["offset", "this_week"], ["type", "ClarkKent::ReportDateFilter"], ["updated_at", "2015-10-05 17:29:46.030462"]]
28055
+  (1.1ms) commit transaction
28056
+ User Load (0.6ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
28057
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
28058
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
28059
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
28060
+ ClarkKent::ReportEmail Load (0.1ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."id" = ? LIMIT 1 [["id", 1]]
28061
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
28062
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
28063
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
28064
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"]]
28065
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
28066
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
28067
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
28068
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
28069
+  (0.1ms) SELECT COUNT(*) FROM "orders" WHERE (orders.user_id > 0)
28070
+ -----------------------------------------------------------------------------------------
28071
+ ClarkKent::ReportEmailTest: test_throws_an_error_if_required_date_filters_are_not_present
28072
+ -----------------------------------------------------------------------------------------
28073
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
28074
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
28075
+ SQL (1.0ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
28076
+  (0.1ms) begin transaction
28077
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
28078
+  (0.7ms) commit transaction
28079
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
28080
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
28081
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
28082
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
28083
+ ClarkKent::ReportEmail Load (0.1ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."id" = ? LIMIT 1 [["id", 2]]
28084
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
28085
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
28086
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
28087
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 2], ["filterable_type", "ClarkKent::ReportEmail"]]
28088
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]
28089
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? AND (clark_kent_report_columns.report_sort is not NULL and clark_kent_report_columns.report_sort != '') ORDER BY clark_kent_report_columns.column_order LIMIT 1 [["report_id", 1]]