clark_kent 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/clark_kent/report_filters_controller.rb +1 -1
  3. data/app/helpers/clark_kent/application_helper.rb +10 -2
  4. data/app/models/clark_kent/report.rb +18 -16
  5. data/app/models/clark_kent/report_column.rb +8 -1
  6. data/app/models/clark_kent/report_config.rb +5 -1
  7. data/app/models/clark_kent/reportable.rb +16 -11
  8. data/app/models/clark_kent/sharing_scope_kind.rb +0 -4
  9. data/app/views/clark_kent/report_filters/_object_filter_edit.html.erb +1 -1
  10. data/app/views/clark_kent/reports/show.html.erb +2 -2
  11. data/lib/clark_kent/version.rb +1 -1
  12. data/test/controllers/clark_kent/reports_controller_test.rb +1 -0
  13. data/test/dummy/app/controllers/orders_controller.rb +5 -0
  14. data/test/dummy/app/models/reporting/order.rb +6 -6
  15. data/test/dummy/app/views/orders/show.html.erb +14 -0
  16. data/test/dummy/config/routes.rb +2 -0
  17. data/test/dummy/db/development.sqlite3 +0 -0
  18. data/test/dummy/db/test.sqlite3 +0 -0
  19. data/test/dummy/log/development.log +2952 -0
  20. data/test/dummy/log/test.log +3051 -0
  21. data/test/dummy/tmp/cache/assets/development/sprockets/0ec37c0a58c1be93659732a3efc73581 +0 -0
  22. data/test/dummy/tmp/cache/assets/development/sprockets/0fd54fd98cd2fa0085b77e6743046927 +0 -0
  23. data/test/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  24. data/test/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  25. data/test/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  26. data/test/dummy/tmp/cache/assets/development/sprockets/8aa37926d964a9eb59cf9b940e4fe2f4 +0 -0
  27. data/test/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  28. data/test/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  29. data/test/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  30. data/test/dummy/tmp/cache/assets/test/sprockets/0ec37c0a58c1be93659732a3efc73581 +0 -0
  31. data/test/dummy/tmp/cache/assets/test/sprockets/0fd54fd98cd2fa0085b77e6743046927 +0 -0
  32. data/test/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  33. data/test/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  34. data/test/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  35. data/test/dummy/tmp/cache/assets/test/sprockets/8aa37926d964a9eb59cf9b940e4fe2f4 +0 -0
  36. data/test/dummy/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  37. data/test/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  38. data/test/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  39. metadata +10 -6
@@ -16803,3 +16803,3054 @@ ClarkKent::ReportEmailTest: test_throws_an_error_if_required_date_filters_are_no
16803
16803
  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"]]
16804
16804
  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]]
16805
16805
  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]]
16806
+  (1.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)) 
16807
+  (0.1ms) select sqlite_version(*)
16808
+  (0.9ms) CREATE INDEX "index_clark_kent_report_columns_on_report_id" ON "clark_kent_report_columns" ("report_id")
16809
+  (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))
16810
+  (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) 
16811
+  (1.1ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_id" ON "clark_kent_report_filters" ("filterable_id")
16812
+  (0.2ms)  SELECT sql
16813
+ FROM sqlite_master
16814
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
16815
+ UNION ALL
16816
+ SELECT sql
16817
+ FROM sqlite_temp_master
16818
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
16819
+ 
16820
+  (0.9ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_type" ON "clark_kent_report_filters" ("filterable_type")
16821
+  (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) 
16822
+  (1.2ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_id" ON "clark_kent_reports" ("sharing_scope_id")
16823
+  (0.1ms)  SELECT sql
16824
+ FROM sqlite_master
16825
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
16826
+ UNION ALL
16827
+ SELECT sql
16828
+ FROM sqlite_temp_master
16829
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
16830
+ 
16831
+  (0.9ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_type" ON "clark_kent_reports" ("sharing_scope_type")
16832
+  (1.3ms) CREATE TABLE "clark_kent_user_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "report_email_id" integer) 
16833
+  (1.2ms) CREATE TABLE "departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255))
16834
+  (1.1ms) CREATE TABLE "orders" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "amount" integer, "description" varchar(255), "created_at" datetime, "updated_at" datetime) 
16835
+  (1.9ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "email" varchar(255), "age" integer, "department_id" integer)
16836
+  (1.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
16837
+  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
16838
+  (0.1ms) SELECT version FROM "schema_migrations"
16839
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20150313144015')
16840
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170042')
16841
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170112')
16842
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140114010048')
16843
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140129051754')
16844
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150304233739')
16845
+  (0.1ms) begin transaction
16846
+ SQL (0.5ms) INSERT INTO "clark_kent_reports" ("created_at", "resource_type", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-04-27 17:51:47.198715"], ["resource_type", "Order"], ["updated_at", "2015-04-27 17:51:47.198715"]]
16847
+  (0.8ms) commit transaction
16848
+  (0.0ms) begin transaction
16849
+ 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]]
16850
+  (0.7ms) commit transaction
16851
+  (0.1ms) begin transaction
16852
+ 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]]
16853
+  (1.0ms) commit transaction
16854
+  (0.1ms) begin transaction
16855
+ SQL (0.4ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "amount"], ["column_order", 3], ["report_id", 1]]
16856
+  (0.7ms) commit transaction
16857
+  (0.1ms) begin transaction
16858
+ 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]]
16859
+  (0.8ms) commit transaction
16860
+  (0.0ms) begin transaction
16861
+ SQL (0.3ms) INSERT INTO "departments" ("name") VALUES (?) [["name", "silly walks"]]
16862
+  (0.7ms) commit transaction
16863
+  (0.1ms) begin transaction
16864
+ SQL (0.3ms) INSERT INTO "users" ("department_id", "email", "name") VALUES (?, ?, ?) [["department_id", 1], ["email", "taproot@gmail.com"], ["name", "Michael Hedges"]]
16865
+  (0.7ms) commit transaction
16866
+  (0.1ms) begin transaction
16867
+ SQL (0.4ms) INSERT INTO "orders" ("amount", "created_at", "description", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["amount", 1], ["created_at", "2015-04-27 17:51:47.250014"], ["description", "Guitar strings"], ["updated_at", "2015-04-27 17:51:47.250014"], ["user_id", 1]]
16868
+  (0.8ms) commit transaction
16869
+ ---------------------------------------------------
16870
+ ClarkKent::ReportEmailTest: test_sends_report_to_s3
16871
+ ---------------------------------------------------
16872
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
16873
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
16874
+ SQL (1.1ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
16875
+  (0.0ms) begin transaction
16876
+ SQL (0.6ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
16877
+  (0.7ms) commit transaction
16878
+  (0.0ms) begin transaction
16879
+ 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-04-27 17:51:47.345650"], ["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-04-27 17:51:47.345650"]]
16880
+  (0.8ms) commit transaction
16881
+ -----------------------------------------------------------------------------------------
16882
+ ClarkKent::ReportEmailTest: test_throws_an_error_if_required_date_filters_are_not_present
16883
+ -----------------------------------------------------------------------------------------
16884
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
16885
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
16886
+ SQL (1.9ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
16887
+  (0.1ms) begin transaction
16888
+ SQL (0.5ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
16889
+  (0.7ms) commit transaction
16890
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
16891
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
16892
+ 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"]]
16893
+ Department Load (0.3ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
16894
+ ClarkKent::ReportEmail Load (0.2ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."id" = ? LIMIT 1 [["id", 2]]
16895
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
16896
+ 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]]
16897
+ 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"]]
16898
+ 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"]]
16899
+ 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]]
16900
+ 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]]
16901
+ -------------------------
16902
+ ClarkKentTest: test_truth
16903
+ -------------------------
16904
+ ------------------------------------------------------------------------------------------------
16905
+ ClarkKent::ReportTest: test_can't_save_without_a_sharing_scope_id_if_the_sharing_scope_is_custom
16906
+ ------------------------------------------------------------------------------------------------
16907
+  (0.1ms) begin transaction
16908
+  (0.1ms) rollback transaction
16909
+ -----------------------------------------------------------
16910
+ ClarkKent::ReportsControllerTest: test_should_create_report
16911
+ -----------------------------------------------------------
16912
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
16913
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
16914
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
16915
+ Processing by ClarkKent::ReportsController#create as HTML
16916
+ Parameters: {"report"=>{"name"=>"delete me", "resource_type"=>"Order", "sharing_scope_id"=>"1", "sharing_scope_type"=>"Department"}, "current_user_id"=>"1"}
16917
+  (0.1ms) begin transaction
16918
+ SQL (0.7ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "sharing_scope_id", "sharing_scope_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-27 17:51:47.428334"], ["name", "delete me"], ["resource_type", "Order"], ["sharing_scope_id", 1], ["sharing_scope_type", "Department"], ["updated_at", "2015-04-27 17:51:47.428334"]]
16919
+  (0.8ms) commit transaction
16920
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
16921
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (3.5ms)
16922
+ 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"]]
16923
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_index.html.erb (2.2ms)
16924
+ 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]]
16925
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_index.html.erb (1.7ms)
16926
+ 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]]
16927
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_index.html.erb (1.7ms)
16928
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/edit.html.erb within layouts/application (19.0ms)
16929
+ Completed 200 OK in 78ms (Views: 73.1ms | ActiveRecord: 2.0ms)
16930
+  (0.2ms) SELECT COUNT(*) FROM "clark_kent_reports"
16931
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."name" = 'delete me' LIMIT 1
16932
+  (0.1ms) begin transaction
16933
+ 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"]]
16934
+ 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]]
16935
+ 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]]
16936
+ SQL (0.3ms) DELETE FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? [["id", 2]]
16937
+  (0.9ms) commit transaction
16938
+ ------------------------------------------------------------
16939
+ ClarkKent::ReportsControllerTest: test_should_destroy_report
16940
+ ------------------------------------------------------------
16941
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
16942
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
16943
+  (0.1ms) begin transaction
16944
+ SQL (0.4ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-27 17:51:47.516023"], ["name", "delete me"], ["resource_type", "Order"], ["updated_at", "2015-04-27 17:51:47.516023"]]
16945
+  (0.8ms) commit transaction
16946
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
16947
+ Processing by ClarkKent::ReportsController#destroy as HTML
16948
+ Parameters: {"current_user_id"=>"1", "id"=>"3"}
16949
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 3]]
16950
+  (0.0ms) begin transaction
16951
+ 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"]]
16952
+ 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]]
16953
+ ClarkKent::ReportEmail Load (0.1ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 3]]
16954
+ SQL (0.3ms) DELETE FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? [["id", 3]]
16955
+  (0.7ms) commit transaction
16956
+ Redirected to http://test.host/reports/reports
16957
+ Completed 302 Found in 7ms (ActiveRecord: 1.5ms)
16958
+  (0.2ms) SELECT COUNT(*) FROM "clark_kent_reports"
16959
+ ------------------------------------------------------
16960
+ ClarkKent::ReportsControllerTest: test_should_get_edit
16961
+ ------------------------------------------------------
16962
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
16963
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
16964
+ Processing by ClarkKent::ReportsController#edit as HTML
16965
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
16966
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
16967
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
16968
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (1.4ms)
16969
+ 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"]]
16970
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_index.html.erb (2.0ms)
16971
+ 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]]
16972
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.8ms)
16973
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (2.3ms)
16974
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.4ms)
16975
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.6ms)
16976
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.4ms)
16977
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.5ms)
16978
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.3ms)
16979
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.5ms)
16980
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_index.html.erb (7.0ms)
16981
+ 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]]
16982
+ 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"]]
16983
+ User Load (0.4ms) 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]]
16984
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show.html.erb (20.1ms)
16985
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show_wrapper.html.erb (22.1ms)
16986
+ 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", 2], ["filterable_type", "ClarkKent::ReportEmail"]]
16987
+ 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]]
16988
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show.html.erb (6.3ms)
16989
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show_wrapper.html.erb (6.9ms)
16990
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_index.html.erb (32.3ms)
16991
+ Completed 200 OK in 47ms (Views: 44.5ms | ActiveRecord: 1.8ms)
16992
+ -------------------------------------------------------
16993
+ ClarkKent::ReportsControllerTest: test_should_get_index
16994
+ -------------------------------------------------------
16995
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
16996
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
16997
+ Processing by ClarkKent::ReportsController#index as HTML
16998
+ Parameters: {"current_user_id"=>"1"}
16999
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
17000
+ 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"]]
17001
+ Department Load (0.2ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
17002
+ 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"]]
17003
+ 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"]]
17004
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" IS NULL
17005
+ Completed 200 OK in 14ms (Views: 12.4ms | ActiveRecord: 1.0ms)
17006
+ -----------------------------------------------------
17007
+ ClarkKent::ReportsControllerTest: test_should_get_new
17008
+ -----------------------------------------------------
17009
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
17010
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
17011
+ Processing by ClarkKent::ReportsController#new as HTML
17012
+ Parameters: {"current_user_id"=>"1"}
17013
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
17014
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
17015
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_edit.html.erb (44.1ms)
17016
+ Completed 200 OK in 50ms (Views: 49.5ms | ActiveRecord: 0.3ms)
17017
+ ---------------------------------------------------------
17018
+ ClarkKent::ReportsControllerTest: test_should_show_report
17019
+ ---------------------------------------------------------
17020
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
17021
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
17022
+ Processing by ClarkKent::ReportsController#show as HTML
17023
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
17024
+ 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
17025
+ 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
17026
+  (0.3ms) 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"]]
17027
+  (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"]]
17028
+  (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"]]
17029
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (1.0ms)
17030
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
17031
+ User Load (0.1ms) SELECT "users".* FROM "users"
17032
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (2.0ms)
17033
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.7ms)
17034
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (0.6ms)
17035
+ Completed 200 OK in 62ms (Views: 53.9ms | ActiveRecord: 1.1ms)
17036
+ -----------------------------------------------------------------
17037
+ ClarkKent::ReportsControllerTest: test_should_show_report_results
17038
+ -----------------------------------------------------------------
17039
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
17040
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
17041
+ Processing by ClarkKent::ReportsController#show as HTML
17042
+ Parameters: {"current_user_id"=>"1", "run_report"=>true, "created_at_until"=>"2015-04-27", "created_at_from"=>"2015-04-26", "id"=>"1"}
17043
+ 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
17044
+ 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
17045
+ 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"]]
17046
+ ClarkKent::ReportColumn Load (0.6ms) 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]]
17047
+ 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]]
17048
+  (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"]]
17049
+  (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"]]
17050
+  (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"]]
17051
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.3ms)
17052
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
17053
+ User Load (0.1ms) SELECT "users".* FROM "users"
17054
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (1.5ms)
17055
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.1ms)
17056
+  (0.1ms) SELECT COUNT(*) FROM "orders"
17057
+  (0.2ms) SELECT COUNT(count_column) FROM (SELECT "orders"."id" AS count_column FROM "orders" LIMIT 10 OFFSET 0) subquery_for_count
17058
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (5.4ms)
17059
+ 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]]
17060
+ Order Load (0.1ms) SELECT DISTINCT orders.id, orders.user_id, orders.amount, orders.description, orders.created_at, orders.updated_at,
17061
+ (SELECT u.name
17062
+ FROM users u
17063
+ WHERE u.id = orders.user_id)
17064
+ as user_name, NULL FROM "orders" LIMIT 10 OFFSET 0
17065
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_download_link.html.erb (1.1ms)
17066
+ Completed 200 OK in 28ms (Views: 18.8ms | ActiveRecord: 2.3ms)
17067
+ --------------------------------------------------------------------
17068
+ ClarkKent::ReportsControllerTest: test_should_show_report_run_errors
17069
+ --------------------------------------------------------------------
17070
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
17071
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
17072
+ Processing by ClarkKent::ReportsController#show as HTML
17073
+ Parameters: {"current_user_id"=>"1", "run_report"=>true, "id"=>"1"}
17074
+ 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
17075
+ 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
17076
+ 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"]]
17077
+ 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]]
17078
+ 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]]
17079
+  (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"]]
17080
+  (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"]]
17081
+  (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"]]
17082
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.3ms)
17083
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
17084
+ User Load (0.3ms) SELECT "users".* FROM "users"
17085
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (2.8ms)
17086
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.2ms)
17087
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (0.0ms)
17088
+ Completed 200 OK in 14ms (Views: 8.3ms | ActiveRecord: 1.5ms)
17089
+ -----------------------------------------------------------
17090
+ ClarkKent::ReportsControllerTest: test_should_update_report
17091
+ -----------------------------------------------------------
17092
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
17093
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
17094
+ Processing by ClarkKent::ReportsController#update as HTML
17095
+ Parameters: {"report"=>{"name"=>nil, "resource_type"=>"Order", "sharing_scope_id"=>"1", "sharing_scope_type"=>"Department"}, "current_user_id"=>"1", "id"=>"1"}
17096
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
17097
+  (0.1ms) begin transaction
17098
+  (0.0ms) commit transaction
17099
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
17100
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (1.6ms)
17101
+ Completed 200 OK in 4ms (Views: 1.9ms | ActiveRecord: 0.3ms)
17102
+  (2.4ms) 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)) 
17103
+  (0.1ms) select sqlite_version(*)
17104
+  (0.9ms) CREATE INDEX "index_clark_kent_report_columns_on_report_id" ON "clark_kent_report_columns" ("report_id")
17105
+  (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))
17106
+  (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) 
17107
+  (1.0ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_id" ON "clark_kent_report_filters" ("filterable_id")
17108
+  (0.1ms)  SELECT sql
17109
+ FROM sqlite_master
17110
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
17111
+ UNION ALL
17112
+ SELECT sql
17113
+ FROM sqlite_temp_master
17114
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
17115
+ 
17116
+  (1.0ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_type" ON "clark_kent_report_filters" ("filterable_type")
17117
+  (1.3ms) 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) 
17118
+  (1.1ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_id" ON "clark_kent_reports" ("sharing_scope_id")
17119
+  (0.1ms)  SELECT sql
17120
+ FROM sqlite_master
17121
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
17122
+ UNION ALL
17123
+ SELECT sql
17124
+ FROM sqlite_temp_master
17125
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
17126
+ 
17127
+  (0.9ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_type" ON "clark_kent_reports" ("sharing_scope_type")
17128
+  (1.0ms) CREATE TABLE "clark_kent_user_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "report_email_id" integer) 
17129
+  (0.9ms) CREATE TABLE "departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255))
17130
+  (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) 
17131
+  (1.1ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "email" varchar(255), "age" integer, "department_id" integer)
17132
+  (0.9ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
17133
+  (0.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
17134
+  (0.1ms) SELECT version FROM "schema_migrations"
17135
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20150313144015')
17136
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170042')
17137
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170112')
17138
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140114010048')
17139
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140129051754')
17140
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20150304233739')
17141
+  (0.1ms) begin transaction
17142
+ SQL (0.4ms) INSERT INTO "clark_kent_reports" ("created_at", "resource_type", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-04-27 17:53:19.464028"], ["resource_type", "Order"], ["updated_at", "2015-04-27 17:53:19.464028"]]
17143
+  (0.8ms) commit transaction
17144
+  (0.1ms) begin transaction
17145
+ 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]]
17146
+  (0.6ms) commit transaction
17147
+  (0.1ms) begin transaction
17148
+ 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]]
17149
+  (1.2ms) commit transaction
17150
+  (0.1ms) begin transaction
17151
+ SQL (0.4ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "amount"], ["column_order", 3], ["report_id", 1]]
17152
+  (0.9ms) commit transaction
17153
+  (0.1ms) begin transaction
17154
+ 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]]
17155
+  (0.7ms) commit transaction
17156
+  (0.1ms) begin transaction
17157
+ SQL (0.3ms) INSERT INTO "departments" ("name") VALUES (?) [["name", "silly walks"]]
17158
+  (0.8ms) commit transaction
17159
+  (0.1ms) begin transaction
17160
+ SQL (0.4ms) INSERT INTO "users" ("department_id", "email", "name") VALUES (?, ?, ?) [["department_id", 1], ["email", "taproot@gmail.com"], ["name", "Michael Hedges"]]
17161
+  (0.7ms) commit transaction
17162
+  (0.0ms) begin transaction
17163
+ SQL (0.3ms) INSERT INTO "orders" ("amount", "created_at", "description", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["amount", 1], ["created_at", "2015-04-27 17:53:19.516531"], ["description", "Guitar strings"], ["updated_at", "2015-04-27 17:53:19.516531"], ["user_id", 1]]
17164
+  (0.7ms) commit transaction
17165
+ ------------------------------------------------------------------------------------------------
17166
+ ClarkKent::ReportTest: test_can't_save_without_a_sharing_scope_id_if_the_sharing_scope_is_custom
17167
+ ------------------------------------------------------------------------------------------------
17168
+  (0.1ms) begin transaction
17169
+  (0.1ms) rollback transaction
17170
+ -----------------------------------------------------------
17171
+ ClarkKent::ReportsControllerTest: test_should_create_report
17172
+ -----------------------------------------------------------
17173
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
17174
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
17175
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
17176
+ Processing by ClarkKent::ReportsController#create as HTML
17177
+ Parameters: {"report"=>{"name"=>"delete me", "resource_type"=>"Order", "sharing_scope_id"=>nil, "sharing_scope_type"=>nil}, "current_user_id"=>"1"}
17178
+  (0.4ms) begin transaction
17179
+ SQL (0.4ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-27 17:53:19.595485"], ["name", "delete me"], ["resource_type", "Order"], ["updated_at", "2015-04-27 17:53:19.595485"]]
17180
+  (0.7ms) commit transaction
17181
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (4.4ms)
17182
+ 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"]]
17183
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_index.html.erb (14.3ms)
17184
+ 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]]
17185
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_index.html.erb (2.9ms)
17186
+ 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]]
17187
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_index.html.erb (8.2ms)
17188
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/edit.html.erb within layouts/application (40.9ms)
17189
+ Completed 200 OK in 65ms (Views: 59.1ms | ActiveRecord: 2.4ms)
17190
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
17191
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."name" = 'delete me' LIMIT 1
17192
+  (0.0ms) begin transaction
17193
+ 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"]]
17194
+ 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]]
17195
+ 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]]
17196
+ SQL (0.4ms) DELETE FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? [["id", 2]]
17197
+  (0.7ms) commit transaction
17198
+ ------------------------------------------------------------
17199
+ ClarkKent::ReportsControllerTest: test_should_destroy_report
17200
+ ------------------------------------------------------------
17201
+ ClarkKent::Report Load (0.3ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
17202
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
17203
+  (0.0ms) begin transaction
17204
+ SQL (0.5ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-27 17:53:19.667635"], ["name", "delete me"], ["resource_type", "Order"], ["updated_at", "2015-04-27 17:53:19.667635"]]
17205
+  (0.8ms) commit transaction
17206
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
17207
+ Processing by ClarkKent::ReportsController#destroy as HTML
17208
+ Parameters: {"current_user_id"=>"1", "id"=>"3"}
17209
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 3]]
17210
+  (0.0ms) begin transaction
17211
+ 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"]]
17212
+ 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]]
17213
+ 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]]
17214
+ SQL (0.3ms) DELETE FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? [["id", 3]]
17215
+  (0.7ms) commit transaction
17216
+ Redirected to http://test.host/reports/reports
17217
+ Completed 302 Found in 5ms (ActiveRecord: 1.3ms)
17218
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
17219
+ ------------------------------------------------------
17220
+ ClarkKent::ReportsControllerTest: test_should_get_edit
17221
+ ------------------------------------------------------
17222
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
17223
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
17224
+ Processing by ClarkKent::ReportsController#edit as HTML
17225
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
17226
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
17227
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (0.9ms)
17228
+ 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"]]
17229
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_index.html.erb (3.3ms)
17230
+ 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]]
17231
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (1.0ms)
17232
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (2.5ms)
17233
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.4ms)
17234
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.5ms)
17235
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.3ms)
17236
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.4ms)
17237
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.3ms)
17238
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.4ms)
17239
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_index.html.erb (7.0ms)
17240
+ 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]]
17241
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_index.html.erb (1.2ms)
17242
+ Completed 200 OK in 16ms (Views: 15.0ms | ActiveRecord: 0.5ms)
17243
+ -------------------------------------------------------
17244
+ ClarkKent::ReportsControllerTest: test_should_get_index
17245
+ -------------------------------------------------------
17246
+ ClarkKent::Report Load (0.3ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
17247
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
17248
+ Processing by ClarkKent::ReportsController#index as HTML
17249
+ Parameters: {"current_user_id"=>"1"}
17250
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
17251
+ 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"]]
17252
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
17253
+ 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"]]
17254
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" IS NULL
17255
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" IS NULL
17256
+ Completed 200 OK in 17ms (Views: 16.1ms | ActiveRecord: 0.7ms)
17257
+ -----------------------------------------------------
17258
+ ClarkKent::ReportsControllerTest: test_should_get_new
17259
+ -----------------------------------------------------
17260
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
17261
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
17262
+ Processing by ClarkKent::ReportsController#new as HTML
17263
+ Parameters: {"current_user_id"=>"1"}
17264
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
17265
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
17266
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_edit.html.erb (43.3ms)
17267
+ Completed 200 OK in 52ms (Views: 50.9ms | ActiveRecord: 0.3ms)
17268
+ ---------------------------------------------------------
17269
+ ClarkKent::ReportsControllerTest: test_should_show_report
17270
+ ---------------------------------------------------------
17271
+ ClarkKent::Report Load (0.3ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
17272
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
17273
+ Processing by ClarkKent::ReportsController#show as HTML
17274
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
17275
+ 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
17276
+ 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
17277
+  (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"]]
17278
+  (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"]]
17279
+  (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"]]
17280
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (2.1ms)
17281
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
17282
+ User Load (0.2ms) SELECT "users".* FROM "users"
17283
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (2.5ms)
17284
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (1.0ms)
17285
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (1.2ms)
17286
+ Completed 200 OK in 28ms (Views: 21.7ms | ActiveRecord: 1.3ms)
17287
+ -----------------------------------------------------------------
17288
+ ClarkKent::ReportsControllerTest: test_should_show_report_results
17289
+ -----------------------------------------------------------------
17290
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
17291
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
17292
+ Processing by ClarkKent::ReportsController#show as HTML
17293
+ Parameters: {"current_user_id"=>"1", "run_report"=>true, "created_at_until"=>"2015-04-27", "created_at_from"=>"2015-04-26", "id"=>"1"}
17294
+ 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
17295
+ 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
17296
+ 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"]]
17297
+ 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]]
17298
+  (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"]]
17299
+  (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"]]
17300
+  (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"]]
17301
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.4ms)
17302
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
17303
+ User Load (0.1ms) SELECT "users".* FROM "users"
17304
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (1.9ms)
17305
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.4ms)
17306
+  (0.2ms) SELECT COUNT(*) FROM "orders"
17307
+  (0.2ms) SELECT COUNT(count_column) FROM (SELECT "orders"."id" AS count_column FROM "orders" LIMIT 10 OFFSET 0) subquery_for_count
17308
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (6.0ms)
17309
+ 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]]
17310
+ Order Load (0.1ms) SELECT DISTINCT orders.id, orders.user_id, orders.amount, orders.description, orders.created_at, orders.updated_at,
17311
+ (SELECT u.name
17312
+ FROM users u
17313
+ WHERE u.id = orders.user_id)
17314
+ as user_name, NULL FROM "orders" LIMIT 10 OFFSET 0
17315
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_download_link.html.erb (0.8ms)
17316
+ Completed 200 OK in 24ms (Views: 18.5ms | ActiveRecord: 1.7ms)
17317
+ --------------------------------------------------------------------
17318
+ ClarkKent::ReportsControllerTest: test_should_show_report_run_errors
17319
+ --------------------------------------------------------------------
17320
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
17321
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
17322
+ Processing by ClarkKent::ReportsController#show as HTML
17323
+ Parameters: {"current_user_id"=>"1", "run_report"=>true, "id"=>"1"}
17324
+ 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
17325
+ ClarkKent::ReportColumn Load (0.3ms) 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
17326
+ 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"]]
17327
+ 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]]
17328
+  (0.5ms) 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"]]
17329
+  (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"]]
17330
+  (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"]]
17331
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.3ms)
17332
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
17333
+ User Load (0.1ms) SELECT "users".* FROM "users"
17334
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (1.4ms)
17335
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.1ms)
17336
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (0.1ms)
17337
+ Completed 200 OK in 17ms (Views: 7.6ms | ActiveRecord: 1.7ms)
17338
+ -----------------------------------------------------------
17339
+ ClarkKent::ReportsControllerTest: test_should_update_report
17340
+ -----------------------------------------------------------
17341
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
17342
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
17343
+ Processing by ClarkKent::ReportsController#update as HTML
17344
+ Parameters: {"report"=>{"name"=>nil, "resource_type"=>"Order", "sharing_scope_id"=>nil, "sharing_scope_type"=>nil}, "current_user_id"=>"1", "id"=>"1"}
17345
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
17346
+  (0.1ms) begin transaction
17347
+  (0.0ms) commit transaction
17348
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (0.9ms)
17349
+ Completed 200 OK in 3ms (Views: 1.2ms | ActiveRecord: 0.2ms)
17350
+ ---------------------------------------------------
17351
+ ClarkKent::ReportEmailTest: test_sends_report_to_s3
17352
+ ---------------------------------------------------
17353
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
17354
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
17355
+ SQL (1.5ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
17356
+  (0.1ms) begin transaction
17357
+ SQL (0.5ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
17358
+  (0.9ms) commit transaction
17359
+  (0.1ms) begin transaction
17360
+ 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-04-27 17:53:19.923395"], ["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-04-27 17:53:19.923395"]]
17361
+  (1.5ms) commit transaction
17362
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
17363
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
17364
+ 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"]]
17365
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
17366
+ 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]]
17367
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
17368
+ 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]]
17369
+ 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"]]
17370
+ 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::ReportEmail"]]
17371
+ 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]]
17372
+ 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]]
17373
+ 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]]
17374
+ 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]]
17375
+  (0.2ms) SELECT COUNT(*) FROM "orders"
17376
+ -----------------------------------------------------------------------------------------
17377
+ ClarkKent::ReportEmailTest: test_throws_an_error_if_required_date_filters_are_not_present
17378
+ -----------------------------------------------------------------------------------------
17379
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
17380
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
17381
+ SQL (1.0ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
17382
+  (0.1ms) begin transaction
17383
+ SQL (0.2ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
17384
+  (0.6ms) commit transaction
17385
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
17386
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
17387
+ 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"]]
17388
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
17389
+ 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]]
17390
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
17391
+ 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]]
17392
+ 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"]]
17393
+ 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"]]
17394
+ 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]]
17395
+ 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]]
17396
+ -------------------------
17397
+ ClarkKentTest: test_truth
17398
+ -------------------------
17399
+  (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)) 
17400
+  (0.1ms) select sqlite_version(*)
17401
+  (0.9ms) CREATE INDEX "index_clark_kent_report_columns_on_report_id" ON "clark_kent_report_columns" ("report_id")
17402
+  (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))
17403
+  (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) 
17404
+  (1.0ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_id" ON "clark_kent_report_filters" ("filterable_id")
17405
+  (0.1ms)  SELECT sql
17406
+ FROM sqlite_master
17407
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
17408
+ UNION ALL
17409
+ SELECT sql
17410
+ FROM sqlite_temp_master
17411
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
17412
+ 
17413
+  (0.9ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_type" ON "clark_kent_report_filters" ("filterable_type")
17414
+  (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) 
17415
+  (1.0ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_id" ON "clark_kent_reports" ("sharing_scope_id")
17416
+  (0.2ms)  SELECT sql
17417
+ FROM sqlite_master
17418
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
17419
+ UNION ALL
17420
+ SELECT sql
17421
+ FROM sqlite_temp_master
17422
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
17423
+ 
17424
+  (1.1ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_type" ON "clark_kent_reports" ("sharing_scope_type")
17425
+  (0.9ms) CREATE TABLE "clark_kent_user_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "report_email_id" integer) 
17426
+  (0.8ms) CREATE TABLE "departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255))
17427
+  (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) 
17428
+  (0.8ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "email" varchar(255), "age" integer, "department_id" integer)
17429
+  (1.0ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
17430
+  (1.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
17431
+  (0.1ms) SELECT version FROM "schema_migrations"
17432
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150313144015')
17433
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170042')
17434
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170112')
17435
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140114010048')
17436
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140129051754')
17437
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20150304233739')
17438
+  (0.1ms) begin transaction
17439
+ SQL (0.4ms) INSERT INTO "clark_kent_reports" ("created_at", "resource_type", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-04-27 17:54:28.752624"], ["resource_type", "Order"], ["updated_at", "2015-04-27 17:54:28.752624"]]
17440
+  (0.8ms) commit transaction
17441
+  (0.1ms) begin transaction
17442
+ 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]]
17443
+  (0.8ms) commit transaction
17444
+  (0.0ms) begin transaction
17445
+ 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]]
17446
+  (0.7ms) commit transaction
17447
+  (0.1ms) begin transaction
17448
+ 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]]
17449
+  (0.7ms) commit transaction
17450
+  (0.1ms) begin transaction
17451
+ 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]]
17452
+  (0.8ms) commit transaction
17453
+  (0.1ms) begin transaction
17454
+ SQL (0.3ms) INSERT INTO "departments" ("name") VALUES (?) [["name", "silly walks"]]
17455
+  (0.9ms) commit transaction
17456
+  (0.0ms) begin transaction
17457
+ SQL (0.4ms) INSERT INTO "users" ("department_id", "email", "name") VALUES (?, ?, ?) [["department_id", 1], ["email", "taproot@gmail.com"], ["name", "Michael Hedges"]]
17458
+  (0.7ms) commit transaction
17459
+  (0.1ms) begin transaction
17460
+ SQL (0.4ms) INSERT INTO "orders" ("amount", "created_at", "description", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["amount", 1], ["created_at", "2015-04-27 17:54:28.803767"], ["description", "Guitar strings"], ["updated_at", "2015-04-27 17:54:28.803767"], ["user_id", 1]]
17461
+  (0.8ms) commit transaction
17462
+ ---------------------------------------------------
17463
+ ClarkKent::ReportEmailTest: test_sends_report_to_s3
17464
+ ---------------------------------------------------
17465
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
17466
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
17467
+ SQL (1.2ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
17468
+  (0.1ms) begin transaction
17469
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
17470
+  (0.7ms) commit transaction
17471
+  (0.0ms) begin transaction
17472
+ SQL (0.7ms) 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-04-27 17:54:28.878641"], ["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-04-27 17:54:28.878641"]]
17473
+  (0.8ms) commit transaction
17474
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
17475
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
17476
+ 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"]]
17477
+ Department Load (0.2ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
17478
+ ClarkKent::ReportEmail Load (0.2ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."id" = ? LIMIT 1 [["id", 1]]
17479
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
17480
+ 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]]
17481
+ 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"]]
17482
+ 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"]]
17483
+ 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]]
17484
+ 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]]
17485
+ 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]]
17486
+ 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]]
17487
+  (0.1ms) SELECT COUNT(*) FROM "orders"
17488
+ -----------------------------------------------------------------------------------------
17489
+ ClarkKent::ReportEmailTest: test_throws_an_error_if_required_date_filters_are_not_present
17490
+ -----------------------------------------------------------------------------------------
17491
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
17492
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
17493
+ SQL (0.9ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
17494
+  (0.1ms) begin transaction
17495
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
17496
+  (0.7ms) commit transaction
17497
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
17498
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
17499
+ 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"]]
17500
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
17501
+ 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]]
17502
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
17503
+ 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]]
17504
+ 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"]]
17505
+ 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"]]
17506
+ 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]]
17507
+ 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]]
17508
+ -------------------------
17509
+ ClarkKentTest: test_truth
17510
+ -------------------------
17511
+ -----------------------------------------------------------
17512
+ ClarkKent::ReportsControllerTest: test_should_create_report
17513
+ -----------------------------------------------------------
17514
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
17515
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
17516
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
17517
+ Processing by ClarkKent::ReportsController#create as HTML
17518
+ Parameters: {"report"=>{"name"=>"delete me", "resource_type"=>"Order", "sharing_scope_id"=>"1", "sharing_scope_type"=>"Department"}, "current_user_id"=>"1"}
17519
+  (0.1ms) begin transaction
17520
+ 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-04-27 17:54:29.016959"], ["name", "delete me"], ["resource_type", "Order"], ["sharing_scope_id", 1], ["sharing_scope_type", "Department"], ["updated_at", "2015-04-27 17:54:29.016959"]]
17521
+  (0.7ms) commit transaction
17522
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
17523
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (3.5ms)
17524
+ 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"]]
17525
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_index.html.erb (2.9ms)
17526
+ 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]]
17527
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_index.html.erb (2.6ms)
17528
+ 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]]
17529
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_index.html.erb (1.8ms)
17530
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/edit.html.erb within layouts/application (20.2ms)
17531
+ Completed 200 OK in 44ms (Views: 40.5ms | ActiveRecord: 1.7ms)
17532
+  (0.2ms) SELECT COUNT(*) FROM "clark_kent_reports"
17533
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."name" = 'delete me' LIMIT 1
17534
+  (0.0ms) begin transaction
17535
+ 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"]]
17536
+ 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]]
17537
+ 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]]
17538
+ SQL (0.3ms) DELETE FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? [["id", 2]]
17539
+  (0.7ms) commit transaction
17540
+ ------------------------------------------------------------
17541
+ ClarkKent::ReportsControllerTest: test_should_destroy_report
17542
+ ------------------------------------------------------------
17543
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
17544
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
17545
+  (0.1ms) begin transaction
17546
+ SQL (0.3ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-27 17:54:29.067841"], ["name", "delete me"], ["resource_type", "Order"], ["updated_at", "2015-04-27 17:54:29.067841"]]
17547
+  (0.7ms) commit transaction
17548
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
17549
+ Processing by ClarkKent::ReportsController#destroy as HTML
17550
+ Parameters: {"current_user_id"=>"1", "id"=>"3"}
17551
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 3]]
17552
+  (0.1ms) begin transaction
17553
+ 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"]]
17554
+ 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]]
17555
+ 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]]
17556
+ SQL (0.5ms) DELETE FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? [["id", 3]]
17557
+  (0.9ms) commit transaction
17558
+ Redirected to http://test.host/reports/reports
17559
+ Completed 302 Found in 6ms (ActiveRecord: 1.8ms)
17560
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
17561
+ ------------------------------------------------------
17562
+ ClarkKent::ReportsControllerTest: test_should_get_edit
17563
+ ------------------------------------------------------
17564
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
17565
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
17566
+ Processing by ClarkKent::ReportsController#edit as HTML
17567
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
17568
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
17569
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
17570
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (1.4ms)
17571
+ 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"]]
17572
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_index.html.erb (1.1ms)
17573
+ 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]]
17574
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (1.1ms)
17575
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (3.3ms)
17576
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.4ms)
17577
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.6ms)
17578
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.3ms)
17579
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.5ms)
17580
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.3ms)
17581
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.5ms)
17582
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_index.html.erb (8.3ms)
17583
+ 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]]
17584
+ 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"]]
17585
+ 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]]
17586
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show.html.erb (16.9ms)
17587
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show_wrapper.html.erb (18.4ms)
17588
+ 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"]]
17589
+ 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]]
17590
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show.html.erb (2.6ms)
17591
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show_wrapper.html.erb (2.8ms)
17592
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_index.html.erb (24.3ms)
17593
+ Completed 200 OK in 70ms (Views: 67.9ms | ActiveRecord: 1.2ms)
17594
+ -------------------------------------------------------
17595
+ ClarkKent::ReportsControllerTest: test_should_get_index
17596
+ -------------------------------------------------------
17597
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
17598
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
17599
+ Processing by ClarkKent::ReportsController#index as HTML
17600
+ Parameters: {"current_user_id"=>"1"}
17601
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
17602
+ 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"]]
17603
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
17604
+ 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"]]
17605
+ 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"]]
17606
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" IS NULL
17607
+ Completed 200 OK in 13ms (Views: 11.7ms | ActiveRecord: 0.9ms)
17608
+ -----------------------------------------------------
17609
+ ClarkKent::ReportsControllerTest: test_should_get_new
17610
+ -----------------------------------------------------
17611
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
17612
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
17613
+ Processing by ClarkKent::ReportsController#new as HTML
17614
+ Parameters: {"current_user_id"=>"1"}
17615
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
17616
+ Department Load (0.2ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
17617
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_edit.html.erb (58.9ms)
17618
+ Completed 200 OK in 66ms (Views: 65.3ms | ActiveRecord: 0.4ms)
17619
+ ---------------------------------------------------------
17620
+ ClarkKent::ReportsControllerTest: test_should_show_report
17621
+ ---------------------------------------------------------
17622
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
17623
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
17624
+ Processing by ClarkKent::ReportsController#show as HTML
17625
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
17626
+ 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
17627
+ 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
17628
+  (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"]]
17629
+  (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"]]
17630
+  (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"]]
17631
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.9ms)
17632
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
17633
+ User Load (0.1ms) SELECT "users".* FROM "users"
17634
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (3.1ms)
17635
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.9ms)
17636
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (0.8ms)
17637
+ Completed 200 OK in 24ms (Views: 16.9ms | ActiveRecord: 1.2ms)
17638
+ -----------------------------------------------------------------
17639
+ ClarkKent::ReportsControllerTest: test_should_show_report_results
17640
+ -----------------------------------------------------------------
17641
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
17642
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
17643
+ Processing by ClarkKent::ReportsController#show as HTML
17644
+ Parameters: {"current_user_id"=>"1", "run_report"=>true, "created_at_until"=>"2015-04-27", "created_at_from"=>"2015-04-26", "id"=>"1"}
17645
+ 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
17646
+ ClarkKent::ReportColumn Load (0.3ms) 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
17647
+ 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"]]
17648
+ 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]]
17649
+ 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]]
17650
+  (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"]]
17651
+  (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"]]
17652
+  (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"]]
17653
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.3ms)
17654
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
17655
+ User Load (0.1ms) SELECT "users".* FROM "users"
17656
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (1.0ms)
17657
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.1ms)
17658
+  (0.1ms) SELECT COUNT(*) FROM "orders"
17659
+  (0.2ms) SELECT COUNT(count_column) FROM (SELECT "orders"."id" AS count_column FROM "orders" LIMIT 10 OFFSET 0) subquery_for_count
17660
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (3.7ms)
17661
+ 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]]
17662
+ Order Load (0.2ms) SELECT DISTINCT orders.id, orders.user_id, orders.amount, orders.description, orders.created_at, orders.updated_at,
17663
+ (SELECT u.name
17664
+ FROM users u
17665
+ WHERE u.id = orders.user_id)
17666
+ as user_name, NULL FROM "orders" LIMIT 10 OFFSET 0
17667
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_download_link.html.erb (1.1ms)
17668
+ Completed 200 OK in 28ms (Views: 18.1ms | ActiveRecord: 2.0ms)
17669
+ --------------------------------------------------------------------
17670
+ ClarkKent::ReportsControllerTest: test_should_show_report_run_errors
17671
+ --------------------------------------------------------------------
17672
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
17673
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
17674
+ Processing by ClarkKent::ReportsController#show as HTML
17675
+ Parameters: {"current_user_id"=>"1", "run_report"=>true, "id"=>"1"}
17676
+ 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
17677
+ 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
17678
+ 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"]]
17679
+ 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]]
17680
+ 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]]
17681
+  (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"]]
17682
+  (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"]]
17683
+  (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"]]
17684
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.2ms)
17685
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
17686
+ User Load (0.1ms) SELECT "users".* FROM "users"
17687
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (1.0ms)
17688
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.2ms)
17689
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (0.1ms)
17690
+ Completed 200 OK in 13ms (Views: 5.9ms | ActiveRecord: 1.2ms)
17691
+ -----------------------------------------------------------
17692
+ ClarkKent::ReportsControllerTest: test_should_update_report
17693
+ -----------------------------------------------------------
17694
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
17695
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
17696
+ Processing by ClarkKent::ReportsController#update as HTML
17697
+ Parameters: {"report"=>{"name"=>nil, "resource_type"=>"Order", "sharing_scope_id"=>"1", "sharing_scope_type"=>"Department"}, "current_user_id"=>"1", "id"=>"1"}
17698
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
17699
+  (0.0ms) begin transaction
17700
+  (0.0ms) commit transaction
17701
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
17702
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (1.9ms)
17703
+ Completed 200 OK in 4ms (Views: 2.2ms | ActiveRecord: 0.2ms)
17704
+ ------------------------------------------------------------------------------------------------
17705
+ ClarkKent::ReportTest: test_can't_save_without_a_sharing_scope_id_if_the_sharing_scope_is_custom
17706
+ ------------------------------------------------------------------------------------------------
17707
+  (0.1ms) begin transaction
17708
+  (0.1ms) rollback transaction
17709
+  (1.3ms) 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)) 
17710
+  (0.1ms) select sqlite_version(*)
17711
+  (1.1ms) CREATE INDEX "index_clark_kent_report_columns_on_report_id" ON "clark_kent_report_columns" ("report_id")
17712
+  (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))
17713
+  (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) 
17714
+  (0.8ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_id" ON "clark_kent_report_filters" ("filterable_id")
17715
+  (0.1ms)  SELECT sql
17716
+ FROM sqlite_master
17717
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
17718
+ UNION ALL
17719
+ SELECT sql
17720
+ FROM sqlite_temp_master
17721
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
17722
+ 
17723
+  (1.0ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_type" ON "clark_kent_report_filters" ("filterable_type")
17724
+  (1.4ms) 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) 
17725
+  (1.0ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_id" ON "clark_kent_reports" ("sharing_scope_id")
17726
+  (0.2ms)  SELECT sql
17727
+ FROM sqlite_master
17728
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
17729
+ UNION ALL
17730
+ SELECT sql
17731
+ FROM sqlite_temp_master
17732
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
17733
+ 
17734
+  (0.9ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_type" ON "clark_kent_reports" ("sharing_scope_type")
17735
+  (1.0ms) CREATE TABLE "clark_kent_user_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "report_email_id" integer) 
17736
+  (0.9ms) CREATE TABLE "departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255))
17737
+  (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) 
17738
+  (0.9ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "email" varchar(255), "age" integer, "department_id" integer)
17739
+  (1.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
17740
+  (1.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
17741
+  (0.2ms) SELECT version FROM "schema_migrations"
17742
+  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20150313144015')
17743
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170042')
17744
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170112')
17745
+  (1.1ms) INSERT INTO "schema_migrations" (version) VALUES ('20140114010048')
17746
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140129051754')
17747
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20150304233739')
17748
+  (0.1ms) begin transaction
17749
+ SQL (0.5ms) INSERT INTO "clark_kent_reports" ("created_at", "resource_type", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-04-27 19:37:53.290067"], ["resource_type", "Order"], ["updated_at", "2015-04-27 19:37:53.290067"]]
17750
+  (0.7ms) commit transaction
17751
+  (0.0ms) begin transaction
17752
+ 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]]
17753
+  (0.7ms) commit transaction
17754
+  (0.1ms) begin transaction
17755
+ 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]]
17756
+  (0.7ms) commit transaction
17757
+  (0.1ms) begin transaction
17758
+ 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]]
17759
+  (0.7ms) commit transaction
17760
+  (0.0ms) begin transaction
17761
+ 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]]
17762
+  (0.7ms) commit transaction
17763
+  (0.1ms) begin transaction
17764
+ SQL (0.6ms) INSERT INTO "departments" ("name") VALUES (?) [["name", "silly walks"]]
17765
+  (0.7ms) commit transaction
17766
+  (0.0ms) begin transaction
17767
+ SQL (0.3ms) INSERT INTO "users" ("department_id", "email", "name") VALUES (?, ?, ?) [["department_id", 1], ["email", "taproot@gmail.com"], ["name", "Michael Hedges"]]
17768
+  (0.7ms) commit transaction
17769
+  (0.1ms) begin transaction
17770
+ SQL (0.3ms) INSERT INTO "orders" ("amount", "created_at", "description", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["amount", 1], ["created_at", "2015-04-27 19:37:53.343008"], ["description", "Guitar strings"], ["updated_at", "2015-04-27 19:37:53.343008"], ["user_id", 1]]
17771
+  (0.6ms) commit transaction
17772
+ -------------------------
17773
+ ClarkKentTest: test_truth
17774
+ -------------------------
17775
+ ---------------------------------------------------
17776
+ ClarkKent::ReportEmailTest: test_sends_report_to_s3
17777
+ ---------------------------------------------------
17778
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
17779
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
17780
+ SQL (1.2ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
17781
+  (0.0ms) begin transaction
17782
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
17783
+  (0.7ms) commit transaction
17784
+  (0.1ms) begin transaction
17785
+ 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-04-27 19:37:53.437663"], ["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-04-27 19:37:53.437663"]]
17786
+  (0.8ms) commit transaction
17787
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
17788
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
17789
+ 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"]]
17790
+ Department Load (0.2ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
17791
+ 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]]
17792
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
17793
+ 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]]
17794
+ 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"]]
17795
+ 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"]]
17796
+ 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]]
17797
+ 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]]
17798
+ 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]]
17799
+ 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]]
17800
+  (0.1ms) SELECT COUNT(*) FROM "orders"
17801
+ -----------------------------------------------------------------------------------------
17802
+ ClarkKent::ReportEmailTest: test_throws_an_error_if_required_date_filters_are_not_present
17803
+ -----------------------------------------------------------------------------------------
17804
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
17805
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
17806
+ SQL (1.1ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
17807
+  (0.1ms) begin transaction
17808
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
17809
+  (0.6ms) commit transaction
17810
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
17811
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
17812
+ 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"]]
17813
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
17814
+ 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]]
17815
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
17816
+ 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]]
17817
+ 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"]]
17818
+ 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"]]
17819
+ 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]]
17820
+ 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]]
17821
+ -----------------------------------------------------------
17822
+ ClarkKent::ReportsControllerTest: test_should_create_report
17823
+ -----------------------------------------------------------
17824
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
17825
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
17826
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
17827
+ Processing by ClarkKent::ReportsController#create as HTML
17828
+ Parameters: {"report"=>{"name"=>"delete me", "resource_type"=>"Order", "sharing_scope_id"=>"1", "sharing_scope_type"=>"Department"}, "current_user_id"=>"1"}
17829
+  (0.1ms) begin transaction
17830
+ SQL (0.7ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "sharing_scope_id", "sharing_scope_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-27 19:37:53.593143"], ["name", "delete me"], ["resource_type", "Order"], ["sharing_scope_id", 1], ["sharing_scope_type", "Department"], ["updated_at", "2015-04-27 19:37:53.593143"]]
17831
+  (0.9ms) commit transaction
17832
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
17833
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (3.8ms)
17834
+ 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"]]
17835
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_index.html.erb (2.4ms)
17836
+ 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]]
17837
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_index.html.erb (2.4ms)
17838
+ 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]]
17839
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_index.html.erb (2.1ms)
17840
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/edit.html.erb within layouts/application (22.2ms)
17841
+ Completed 200 OK in 61ms (Views: 55.0ms | ActiveRecord: 2.2ms)
17842
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
17843
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."name" = 'delete me' LIMIT 1
17844
+  (0.0ms) begin transaction
17845
+ 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"]]
17846
+ 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]]
17847
+ 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]]
17848
+ SQL (0.6ms) DELETE FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? [["id", 2]]
17849
+  (0.9ms) commit transaction
17850
+ ------------------------------------------------------------
17851
+ ClarkKent::ReportsControllerTest: test_should_destroy_report
17852
+ ------------------------------------------------------------
17853
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
17854
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
17855
+  (0.1ms) begin transaction
17856
+ SQL (0.4ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-27 19:37:53.660741"], ["name", "delete me"], ["resource_type", "Order"], ["updated_at", "2015-04-27 19:37:53.660741"]]
17857
+  (0.8ms) commit transaction
17858
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
17859
+ Processing by ClarkKent::ReportsController#destroy as HTML
17860
+ Parameters: {"current_user_id"=>"1", "id"=>"3"}
17861
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 3]]
17862
+  (0.1ms) begin transaction
17863
+ 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"]]
17864
+ 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]]
17865
+ 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]]
17866
+ SQL (0.3ms) DELETE FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? [["id", 3]]
17867
+  (0.7ms) commit transaction
17868
+ Redirected to http://test.host/reports/reports
17869
+ Completed 302 Found in 5ms (ActiveRecord: 1.2ms)
17870
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
17871
+ ------------------------------------------------------
17872
+ ClarkKent::ReportsControllerTest: test_should_get_edit
17873
+ ------------------------------------------------------
17874
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
17875
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
17876
+ Processing by ClarkKent::ReportsController#edit as HTML
17877
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
17878
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
17879
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
17880
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (1.9ms)
17881
+ 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"]]
17882
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_index.html.erb (1.7ms)
17883
+ 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]]
17884
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (1.1ms)
17885
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (2.9ms)
17886
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.4ms)
17887
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.6ms)
17888
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.4ms)
17889
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.5ms)
17890
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.4ms)
17891
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.6ms)
17892
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_index.html.erb (7.7ms)
17893
+ 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]]
17894
+ 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"]]
17895
+ 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]]
17896
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show.html.erb (22.3ms)
17897
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show_wrapper.html.erb (24.3ms)
17898
+ 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"]]
17899
+ 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]]
17900
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show.html.erb (2.3ms)
17901
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show_wrapper.html.erb (2.5ms)
17902
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_index.html.erb (29.6ms)
17903
+ Completed 200 OK in 77ms (Views: 74.7ms | ActiveRecord: 1.3ms)
17904
+ -------------------------------------------------------
17905
+ ClarkKent::ReportsControllerTest: test_should_get_index
17906
+ -------------------------------------------------------
17907
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
17908
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
17909
+ Processing by ClarkKent::ReportsController#index as HTML
17910
+ Parameters: {"current_user_id"=>"1"}
17911
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
17912
+ 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"]]
17913
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
17914
+ 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"]]
17915
+ 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"]]
17916
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" IS NULL
17917
+ Completed 200 OK in 14ms (Views: 12.8ms | ActiveRecord: 0.7ms)
17918
+ -----------------------------------------------------
17919
+ ClarkKent::ReportsControllerTest: test_should_get_new
17920
+ -----------------------------------------------------
17921
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
17922
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
17923
+ Processing by ClarkKent::ReportsController#new as HTML
17924
+ Parameters: {"current_user_id"=>"1"}
17925
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
17926
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
17927
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_edit.html.erb (70.9ms)
17928
+ Completed 200 OK in 77ms (Views: 75.9ms | ActiveRecord: 0.3ms)
17929
+ ---------------------------------------------------------
17930
+ ClarkKent::ReportsControllerTest: test_should_show_report
17931
+ ---------------------------------------------------------
17932
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
17933
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
17934
+ Processing by ClarkKent::ReportsController#show as HTML
17935
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
17936
+ 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
17937
+ 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
17938
+  (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"]]
17939
+  (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"]]
17940
+  (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"]]
17941
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.9ms)
17942
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
17943
+ User Load (0.1ms) SELECT "users".* FROM "users"
17944
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (1.8ms)
17945
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.6ms)
17946
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (0.8ms)
17947
+ Completed 200 OK in 24ms (Views: 17.7ms | ActiveRecord: 1.0ms)
17948
+ -----------------------------------------------------------------
17949
+ ClarkKent::ReportsControllerTest: test_should_show_report_results
17950
+ -----------------------------------------------------------------
17951
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
17952
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
17953
+ Processing by ClarkKent::ReportsController#show as HTML
17954
+ Parameters: {"current_user_id"=>"1", "run_report"=>true, "created_at_until"=>"2015-04-27", "created_at_from"=>"2015-04-26", "id"=>"1"}
17955
+ 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
17956
+ 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
17957
+ 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"]]
17958
+ 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]]
17959
+ 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]]
17960
+  (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"]]
17961
+  (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"]]
17962
+  (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"]]
17963
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.3ms)
17964
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
17965
+ User Load (0.1ms) SELECT "users".* FROM "users"
17966
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (1.0ms)
17967
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.1ms)
17968
+  (0.2ms) SELECT COUNT(*) FROM "orders"
17969
+  (0.2ms) SELECT COUNT(count_column) FROM (SELECT "orders"."id" AS count_column FROM "orders" LIMIT 10 OFFSET 0) subquery_for_count
17970
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (6.5ms)
17971
+ 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]]
17972
+ Order Load (0.2ms) SELECT DISTINCT orders.id, orders.user_id, orders.amount, orders.description, orders.created_at, orders.updated_at,
17973
+ (SELECT u.name
17974
+ FROM users u
17975
+ WHERE u.id = orders.user_id)
17976
+ as user_name, NULL FROM "orders" LIMIT 10 OFFSET 0
17977
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
17978
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
17979
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
17980
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
17981
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_download_link.html.erb (1.3ms)
17982
+ Completed 200 OK in 32ms (Views: 24.8ms | ActiveRecord: 2.2ms)
17983
+ --------------------------------------------------------------------
17984
+ ClarkKent::ReportsControllerTest: test_should_show_report_run_errors
17985
+ --------------------------------------------------------------------
17986
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
17987
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
17988
+ Processing by ClarkKent::ReportsController#show as HTML
17989
+ Parameters: {"current_user_id"=>"1", "run_report"=>true, "id"=>"1"}
17990
+ 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
17991
+ 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
17992
+ 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"]]
17993
+ 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]]
17994
+ 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]]
17995
+  (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"]]
17996
+  (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"]]
17997
+  (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"]]
17998
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.3ms)
17999
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
18000
+ User Load (0.1ms) SELECT "users".* FROM "users"
18001
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (1.4ms)
18002
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.1ms)
18003
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (0.1ms)
18004
+ Completed 200 OK in 13ms (Views: 7.0ms | ActiveRecord: 1.4ms)
18005
+ -----------------------------------------------------------
18006
+ ClarkKent::ReportsControllerTest: test_should_update_report
18007
+ -----------------------------------------------------------
18008
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
18009
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
18010
+ Processing by ClarkKent::ReportsController#update as HTML
18011
+ Parameters: {"report"=>{"name"=>nil, "resource_type"=>"Order", "sharing_scope_id"=>"1", "sharing_scope_type"=>"Department"}, "current_user_id"=>"1", "id"=>"1"}
18012
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
18013
+  (0.0ms) begin transaction
18014
+  (0.0ms) commit transaction
18015
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
18016
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (1.5ms)
18017
+ Completed 200 OK in 4ms (Views: 1.8ms | ActiveRecord: 0.3ms)
18018
+ ------------------------------------------------------------------------------------------------
18019
+ ClarkKent::ReportTest: test_can't_save_without_a_sharing_scope_id_if_the_sharing_scope_is_custom
18020
+ ------------------------------------------------------------------------------------------------
18021
+  (0.0ms) begin transaction
18022
+  (0.1ms) rollback transaction
18023
+  (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)) 
18024
+  (0.1ms) select sqlite_version(*)
18025
+  (0.9ms) CREATE INDEX "index_clark_kent_report_columns_on_report_id" ON "clark_kent_report_columns" ("report_id")
18026
+  (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))
18027
+  (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) 
18028
+  (0.9ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_id" ON "clark_kent_report_filters" ("filterable_id")
18029
+  (0.2ms)  SELECT sql
18030
+ FROM sqlite_master
18031
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
18032
+ UNION ALL
18033
+ SELECT sql
18034
+ FROM sqlite_temp_master
18035
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
18036
+ 
18037
+  (1.1ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_type" ON "clark_kent_report_filters" ("filterable_type")
18038
+  (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) 
18039
+  (1.0ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_id" ON "clark_kent_reports" ("sharing_scope_id")
18040
+  (0.1ms)  SELECT sql
18041
+ FROM sqlite_master
18042
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
18043
+ UNION ALL
18044
+ SELECT sql
18045
+ FROM sqlite_temp_master
18046
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
18047
+ 
18048
+  (0.8ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_type" ON "clark_kent_reports" ("sharing_scope_type")
18049
+  (0.9ms) CREATE TABLE "clark_kent_user_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "report_email_id" integer) 
18050
+  (1.1ms) CREATE TABLE "departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255))
18051
+  (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) 
18052
+  (0.9ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "email" varchar(255), "age" integer, "department_id" integer)
18053
+  (1.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
18054
+  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
18055
+  (0.1ms) SELECT version FROM "schema_migrations"
18056
+  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20150313144015')
18057
+  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170042')
18058
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170112')
18059
+  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20140114010048')
18060
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140129051754')
18061
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150304233739')
18062
+  (0.1ms) begin transaction
18063
+ SQL (0.4ms) INSERT INTO "clark_kent_reports" ("created_at", "resource_type", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-04-27 19:38:12.396672"], ["resource_type", "Order"], ["updated_at", "2015-04-27 19:38:12.396672"]]
18064
+  (0.9ms) commit transaction
18065
+  (0.0ms) begin transaction
18066
+ 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]]
18067
+  (0.8ms) commit transaction
18068
+  (0.1ms) begin transaction
18069
+ 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]]
18070
+  (0.7ms) commit transaction
18071
+  (0.1ms) begin transaction
18072
+ SQL (0.4ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "amount"], ["column_order", 3], ["report_id", 1]]
18073
+  (0.8ms) commit transaction
18074
+  (0.0ms) begin transaction
18075
+ SQL (0.4ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "description"], ["column_order", 4], ["report_id", 1]]
18076
+  (0.8ms) commit transaction
18077
+  (0.1ms) begin transaction
18078
+ SQL (0.3ms) INSERT INTO "departments" ("name") VALUES (?) [["name", "silly walks"]]
18079
+  (0.7ms) commit transaction
18080
+  (0.1ms) begin transaction
18081
+ SQL (0.4ms) INSERT INTO "users" ("department_id", "email", "name") VALUES (?, ?, ?) [["department_id", 1], ["email", "taproot@gmail.com"], ["name", "Michael Hedges"]]
18082
+  (0.7ms) commit transaction
18083
+  (0.1ms) begin transaction
18084
+ SQL (0.3ms) INSERT INTO "orders" ("amount", "created_at", "description", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["amount", 1], ["created_at", "2015-04-27 19:38:12.447002"], ["description", "Guitar strings"], ["updated_at", "2015-04-27 19:38:12.447002"], ["user_id", 1]]
18085
+  (0.7ms) commit transaction
18086
+ -------------------------
18087
+ ClarkKentTest: test_truth
18088
+ -------------------------
18089
+ ------------------------------------------------------------------------------------------------
18090
+ ClarkKent::ReportTest: test_can't_save_without_a_sharing_scope_id_if_the_sharing_scope_is_custom
18091
+ ------------------------------------------------------------------------------------------------
18092
+  (0.1ms) begin transaction
18093
+  (0.1ms) rollback transaction
18094
+ ---------------------------------------------------
18095
+ ClarkKent::ReportEmailTest: test_sends_report_to_s3
18096
+ ---------------------------------------------------
18097
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
18098
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
18099
+ SQL (1.0ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
18100
+  (0.0ms) begin transaction
18101
+ SQL (0.4ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
18102
+  (0.8ms) commit transaction
18103
+  (0.0ms) begin transaction
18104
+ 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-04-27 19:38:12.532614"], ["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-04-27 19:38:12.532614"]]
18105
+  (0.9ms) commit transaction
18106
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
18107
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
18108
+ 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"]]
18109
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
18110
+ 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]]
18111
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
18112
+ 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]]
18113
+ 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"]]
18114
+ 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"]]
18115
+ 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]]
18116
+ 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]]
18117
+ 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]]
18118
+ 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]]
18119
+  (0.1ms) SELECT COUNT(*) FROM "orders"
18120
+ -----------------------------------------------------------------------------------------
18121
+ ClarkKent::ReportEmailTest: test_throws_an_error_if_required_date_filters_are_not_present
18122
+ -----------------------------------------------------------------------------------------
18123
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
18124
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
18125
+ SQL (0.9ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
18126
+  (0.0ms) begin transaction
18127
+ SQL (0.2ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
18128
+  (0.7ms) commit transaction
18129
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
18130
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
18131
+ 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"]]
18132
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
18133
+ 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]]
18134
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
18135
+ 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]]
18136
+ 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"]]
18137
+ 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"]]
18138
+ 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]]
18139
+ 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]]
18140
+ -----------------------------------------------------------
18141
+ ClarkKent::ReportsControllerTest: test_should_create_report
18142
+ -----------------------------------------------------------
18143
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
18144
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
18145
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
18146
+ Processing by ClarkKent::ReportsController#create as HTML
18147
+ Parameters: {"report"=>{"name"=>"delete me", "resource_type"=>"Order", "sharing_scope_id"=>"1", "sharing_scope_type"=>"Department"}, "current_user_id"=>"1"}
18148
+  (0.1ms) begin transaction
18149
+ SQL (0.5ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "sharing_scope_id", "sharing_scope_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", "2015-04-27 19:38:12.657665"], ["name", "delete me"], ["resource_type", "Order"], ["sharing_scope_id", 1], ["sharing_scope_type", "Department"], ["updated_at", "2015-04-27 19:38:12.657665"]]
18150
+  (1.0ms) commit transaction
18151
+ Department Load (0.2ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
18152
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (4.4ms)
18153
+ 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"]]
18154
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_index.html.erb (2.3ms)
18155
+ 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]]
18156
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_index.html.erb (1.8ms)
18157
+ 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]]
18158
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_index.html.erb (2.0ms)
18159
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/edit.html.erb within layouts/application (19.4ms)
18160
+ Completed 200 OK in 44ms (Views: 37.9ms | ActiveRecord: 2.2ms)
18161
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
18162
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."name" = 'delete me' LIMIT 1
18163
+  (0.0ms) begin transaction
18164
+ 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"]]
18165
+ 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]]
18166
+ 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]]
18167
+ SQL (0.3ms) DELETE FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? [["id", 2]]
18168
+  (0.7ms) commit transaction
18169
+ ------------------------------------------------------------
18170
+ ClarkKent::ReportsControllerTest: test_should_destroy_report
18171
+ ------------------------------------------------------------
18172
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
18173
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
18174
+  (0.1ms) begin transaction
18175
+ SQL (0.4ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-27 19:38:12.706236"], ["name", "delete me"], ["resource_type", "Order"], ["updated_at", "2015-04-27 19:38:12.706236"]]
18176
+  (0.8ms) commit transaction
18177
+  (0.2ms) SELECT COUNT(*) FROM "clark_kent_reports"
18178
+ Processing by ClarkKent::ReportsController#destroy as HTML
18179
+ Parameters: {"current_user_id"=>"1", "id"=>"3"}
18180
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 3]]
18181
+  (0.1ms) begin transaction
18182
+ 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"]]
18183
+ 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]]
18184
+ 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]]
18185
+ SQL (0.4ms) DELETE FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? [["id", 3]]
18186
+  (0.9ms) commit transaction
18187
+ Redirected to http://test.host/reports/reports
18188
+ Completed 302 Found in 6ms (ActiveRecord: 1.6ms)
18189
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
18190
+ ------------------------------------------------------
18191
+ ClarkKent::ReportsControllerTest: test_should_get_edit
18192
+ ------------------------------------------------------
18193
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
18194
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
18195
+ Processing by ClarkKent::ReportsController#edit as HTML
18196
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
18197
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
18198
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
18199
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (2.4ms)
18200
+ 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"]]
18201
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_index.html.erb (2.1ms)
18202
+ 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]]
18203
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (1.0ms)
18204
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (2.3ms)
18205
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.4ms)
18206
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.5ms)
18207
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.3ms)
18208
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.5ms)
18209
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.3ms)
18210
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.4ms)
18211
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_index.html.erb (6.5ms)
18212
+ 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]]
18213
+ ClarkKent::ReportDateFilter Load (0.3ms) 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"]]
18214
+ 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]]
18215
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show.html.erb (18.3ms)
18216
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show_wrapper.html.erb (19.9ms)
18217
+ 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"]]
18218
+ 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]]
18219
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show.html.erb (34.5ms)
18220
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show_wrapper.html.erb (34.9ms)
18221
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_index.html.erb (57.2ms)
18222
+ Completed 200 OK in 73ms (Views: 70.2ms | ActiveRecord: 1.5ms)
18223
+ -------------------------------------------------------
18224
+ ClarkKent::ReportsControllerTest: test_should_get_index
18225
+ -------------------------------------------------------
18226
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
18227
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
18228
+ Processing by ClarkKent::ReportsController#index as HTML
18229
+ Parameters: {"current_user_id"=>"1"}
18230
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
18231
+ 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"]]
18232
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
18233
+ 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"]]
18234
+ 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"]]
18235
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" IS NULL
18236
+ Completed 200 OK in 13ms (Views: 11.7ms | ActiveRecord: 0.8ms)
18237
+ -----------------------------------------------------
18238
+ ClarkKent::ReportsControllerTest: test_should_get_new
18239
+ -----------------------------------------------------
18240
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
18241
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
18242
+ Processing by ClarkKent::ReportsController#new as HTML
18243
+ Parameters: {"current_user_id"=>"1"}
18244
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
18245
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
18246
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_edit.html.erb (39.1ms)
18247
+ Completed 200 OK in 44ms (Views: 43.5ms | ActiveRecord: 0.2ms)
18248
+ ---------------------------------------------------------
18249
+ ClarkKent::ReportsControllerTest: test_should_show_report
18250
+ ---------------------------------------------------------
18251
+ ClarkKent::Report Load (0.3ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
18252
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
18253
+ Processing by ClarkKent::ReportsController#show as HTML
18254
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
18255
+ 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
18256
+ 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
18257
+ Order Load (0.1ms) SELECT "orders".* FROM "orders"
18258
+ Department Load (0.2ms) SELECT "departments".* FROM "departments"
18259
+ User Load (0.1ms) SELECT "users".* FROM "users"
18260
+ Completed 500 Internal Server Error in 34ms
18261
+ -----------------------------------------------------------------
18262
+ ClarkKent::ReportsControllerTest: test_should_show_report_results
18263
+ -----------------------------------------------------------------
18264
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
18265
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
18266
+ Processing by ClarkKent::ReportsController#show as HTML
18267
+ Parameters: {"current_user_id"=>"1", "run_report"=>true, "created_at_until"=>"2015-04-27", "created_at_from"=>"2015-04-26", "id"=>"1"}
18268
+ 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
18269
+ 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
18270
+ 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"]]
18271
+ 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]]
18272
+ 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]]
18273
+ Order Load (0.2ms) SELECT "orders".* FROM "orders"
18274
+ Department Load (0.1ms) SELECT "departments".* FROM "departments"
18275
+ User Load (0.1ms) SELECT "users".* FROM "users"
18276
+ Order Load (0.1ms) SELECT DISTINCT orders.id, orders.user_id, orders.amount, orders.description, orders.created_at, orders.updated_at,
18277
+ (SELECT u.name
18278
+ FROM users u
18279
+ WHERE u.id = orders.user_id)
18280
+ as user_name, NULL FROM "orders" LIMIT 10 OFFSET 0
18281
+ Completed 500 Internal Server Error in 32ms
18282
+ --------------------------------------------------------------------
18283
+ ClarkKent::ReportsControllerTest: test_should_show_report_run_errors
18284
+ --------------------------------------------------------------------
18285
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
18286
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
18287
+ Processing by ClarkKent::ReportsController#show as HTML
18288
+ Parameters: {"current_user_id"=>"1", "run_report"=>true, "id"=>"1"}
18289
+ 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
18290
+ 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
18291
+ 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"]]
18292
+ 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]]
18293
+ 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]]
18294
+ Order Load (0.2ms) SELECT "orders".* FROM "orders"
18295
+ Department Load (0.1ms) SELECT "departments".* FROM "departments"
18296
+ User Load (0.1ms) SELECT "users".* FROM "users"
18297
+ Completed 500 Internal Server Error in 33ms
18298
+ -----------------------------------------------------------
18299
+ ClarkKent::ReportsControllerTest: test_should_update_report
18300
+ -----------------------------------------------------------
18301
+ ClarkKent::Report Load (0.3ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
18302
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
18303
+ Processing by ClarkKent::ReportsController#update as HTML
18304
+ Parameters: {"report"=>{"name"=>nil, "resource_type"=>"Order", "sharing_scope_id"=>"1", "sharing_scope_type"=>"Department"}, "current_user_id"=>"1", "id"=>"1"}
18305
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
18306
+  (0.1ms) begin transaction
18307
+  (0.1ms) commit transaction
18308
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
18309
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (1.7ms)
18310
+ Completed 200 OK in 5ms (Views: 2.1ms | ActiveRecord: 0.4ms)
18311
+  (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)) 
18312
+  (0.1ms) select sqlite_version(*)
18313
+  (1.0ms) CREATE INDEX "index_clark_kent_report_columns_on_report_id" ON "clark_kent_report_columns" ("report_id")
18314
+  (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))
18315
+  (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) 
18316
+  (1.2ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_id" ON "clark_kent_report_filters" ("filterable_id")
18317
+  (0.2ms)  SELECT sql
18318
+ FROM sqlite_master
18319
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
18320
+ UNION ALL
18321
+ SELECT sql
18322
+ FROM sqlite_temp_master
18323
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
18324
+ 
18325
+  (1.1ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_type" ON "clark_kent_report_filters" ("filterable_type")
18326
+  (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) 
18327
+  (1.3ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_id" ON "clark_kent_reports" ("sharing_scope_id")
18328
+  (0.2ms)  SELECT sql
18329
+ FROM sqlite_master
18330
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
18331
+ UNION ALL
18332
+ SELECT sql
18333
+ FROM sqlite_temp_master
18334
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
18335
+ 
18336
+  (1.0ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_type" ON "clark_kent_reports" ("sharing_scope_type")
18337
+  (0.9ms) CREATE TABLE "clark_kent_user_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "report_email_id" integer) 
18338
+  (0.9ms) CREATE TABLE "departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255))
18339
+  (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) 
18340
+  (1.2ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "email" varchar(255), "age" integer, "department_id" integer)
18341
+  (0.9ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
18342
+  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
18343
+  (0.1ms) SELECT version FROM "schema_migrations"
18344
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150313144015')
18345
+  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170042')
18346
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170112')
18347
+  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20140114010048')
18348
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140129051754')
18349
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20150304233739')
18350
+  (0.1ms) begin transaction
18351
+ SQL (0.9ms) INSERT INTO "clark_kent_reports" ("created_at", "resource_type", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-04-27 19:40:28.281190"], ["resource_type", "Order"], ["updated_at", "2015-04-27 19:40:28.281190"]]
18352
+  (0.8ms) commit transaction
18353
+  (0.5ms) begin transaction
18354
+ 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]]
18355
+  (0.7ms) commit transaction
18356
+  (0.1ms) begin transaction
18357
+ 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]]
18358
+  (0.7ms) commit transaction
18359
+  (0.1ms) begin transaction
18360
+ 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]]
18361
+  (0.8ms) commit transaction
18362
+  (0.1ms) begin transaction
18363
+ SQL (0.5ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "description"], ["column_order", 4], ["report_id", 1]]
18364
+  (0.7ms) commit transaction
18365
+  (0.0ms) begin transaction
18366
+ SQL (0.3ms) INSERT INTO "departments" ("name") VALUES (?) [["name", "silly walks"]]
18367
+  (0.8ms) commit transaction
18368
+  (0.1ms) begin transaction
18369
+ SQL (0.5ms) INSERT INTO "users" ("department_id", "email", "name") VALUES (?, ?, ?) [["department_id", 1], ["email", "taproot@gmail.com"], ["name", "Michael Hedges"]]
18370
+  (0.8ms) commit transaction
18371
+  (0.0ms) begin transaction
18372
+ SQL (0.3ms) INSERT INTO "orders" ("amount", "created_at", "description", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["amount", 1], ["created_at", "2015-04-27 19:40:28.339969"], ["description", "Guitar strings"], ["updated_at", "2015-04-27 19:40:28.339969"], ["user_id", 1]]
18373
+  (0.9ms) commit transaction
18374
+ -------------------------
18375
+ ClarkKentTest: test_truth
18376
+ -------------------------
18377
+ ------------------------------------------------------------------------------------------------
18378
+ ClarkKent::ReportTest: test_can't_save_without_a_sharing_scope_id_if_the_sharing_scope_is_custom
18379
+ ------------------------------------------------------------------------------------------------
18380
+  (0.1ms) begin transaction
18381
+  (0.1ms) rollback transaction
18382
+ ---------------------------------------------------
18383
+ ClarkKent::ReportEmailTest: test_sends_report_to_s3
18384
+ ---------------------------------------------------
18385
+ User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
18386
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
18387
+ SQL (1.7ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
18388
+  (0.0ms) begin transaction
18389
+ SQL (0.4ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
18390
+  (1.0ms) commit transaction
18391
+  (0.1ms) begin transaction
18392
+ SQL (0.8ms) 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-04-27 19:40:28.432825"], ["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-04-27 19:40:28.432825"]]
18393
+  (0.9ms) commit transaction
18394
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
18395
+ ClarkKent::Report Load (0.3ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
18396
+ 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"]]
18397
+ Department Load (0.2ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
18398
+ 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]]
18399
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
18400
+ 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]]
18401
+ 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"]]
18402
+ 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"]]
18403
+ 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]]
18404
+ 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]]
18405
+ 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]]
18406
+ 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]]
18407
+  (0.2ms) SELECT COUNT(*) FROM "orders"
18408
+ -----------------------------------------------------------------------------------------
18409
+ ClarkKent::ReportEmailTest: test_throws_an_error_if_required_date_filters_are_not_present
18410
+ -----------------------------------------------------------------------------------------
18411
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
18412
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
18413
+ SQL (0.9ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
18414
+  (0.1ms) begin transaction
18415
+ SQL (0.2ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
18416
+  (0.6ms) commit transaction
18417
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
18418
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
18419
+ 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"]]
18420
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
18421
+ 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]]
18422
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
18423
+ 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]]
18424
+ 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"]]
18425
+ 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"]]
18426
+ 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]]
18427
+ 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]]
18428
+ -----------------------------------------------------------
18429
+ ClarkKent::ReportsControllerTest: test_should_create_report
18430
+ -----------------------------------------------------------
18431
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
18432
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
18433
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
18434
+ Processing by ClarkKent::ReportsController#create as HTML
18435
+ Parameters: {"report"=>{"name"=>"delete me", "resource_type"=>"Order", "sharing_scope_id"=>"1", "sharing_scope_type"=>"Department"}, "current_user_id"=>"1"}
18436
+  (0.1ms) begin transaction
18437
+ 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-04-27 19:40:28.571313"], ["name", "delete me"], ["resource_type", "Order"], ["sharing_scope_id", 1], ["sharing_scope_type", "Department"], ["updated_at", "2015-04-27 19:40:28.571313"]]
18438
+  (0.8ms) commit transaction
18439
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
18440
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (3.2ms)
18441
+ 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"]]
18442
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_index.html.erb (2.1ms)
18443
+ 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]]
18444
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_index.html.erb (2.5ms)
18445
+ ClarkKent::ReportEmail Load (0.3ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 2]]
18446
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_index.html.erb (2.5ms)
18447
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/edit.html.erb within layouts/application (19.4ms)
18448
+ Completed 200 OK in 41ms (Views: 37.2ms | ActiveRecord: 1.8ms)
18449
+  (0.2ms) SELECT COUNT(*) FROM "clark_kent_reports"
18450
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."name" = 'delete me' LIMIT 1
18451
+  (0.0ms) begin transaction
18452
+ 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", 2], ["filterable_type", "ClarkKent::Report"]]
18453
+ 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]]
18454
+ 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]]
18455
+ SQL (0.3ms) DELETE FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? [["id", 2]]
18456
+  (0.7ms) commit transaction
18457
+ ------------------------------------------------------------
18458
+ ClarkKent::ReportsControllerTest: test_should_destroy_report
18459
+ ------------------------------------------------------------
18460
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
18461
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
18462
+  (0.1ms) begin transaction
18463
+ SQL (0.3ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-27 19:40:28.620752"], ["name", "delete me"], ["resource_type", "Order"], ["updated_at", "2015-04-27 19:40:28.620752"]]
18464
+  (0.8ms) commit transaction
18465
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
18466
+ Processing by ClarkKent::ReportsController#destroy as HTML
18467
+ Parameters: {"current_user_id"=>"1", "id"=>"3"}
18468
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 3]]
18469
+  (0.1ms) begin transaction
18470
+ 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"]]
18471
+ 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]]
18472
+ 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]]
18473
+ SQL (0.5ms) DELETE FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? [["id", 3]]
18474
+  (0.8ms) commit transaction
18475
+ Redirected to http://test.host/reports/reports
18476
+ Completed 302 Found in 5ms (ActiveRecord: 1.5ms)
18477
+  (0.2ms) SELECT COUNT(*) FROM "clark_kent_reports"
18478
+ ------------------------------------------------------
18479
+ ClarkKent::ReportsControllerTest: test_should_get_edit
18480
+ ------------------------------------------------------
18481
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
18482
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
18483
+ Processing by ClarkKent::ReportsController#edit as HTML
18484
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
18485
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
18486
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
18487
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (1.5ms)
18488
+ 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"]]
18489
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_index.html.erb (1.3ms)
18490
+ 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]]
18491
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (4.3ms)
18492
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (6.5ms)
18493
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.9ms)
18494
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (1.5ms)
18495
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.6ms)
18496
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.9ms)
18497
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.7ms)
18498
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (1.4ms)
18499
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_index.html.erb (13.9ms)
18500
+ 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]]
18501
+ ClarkKent::ReportDateFilter Load (0.4ms) 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"]]
18502
+ 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]]
18503
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show.html.erb (19.3ms)
18504
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show_wrapper.html.erb (20.9ms)
18505
+ 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"]]
18506
+ 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]]
18507
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show.html.erb (35.7ms)
18508
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show_wrapper.html.erb (35.9ms)
18509
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_index.html.erb (59.7ms)
18510
+ Completed 200 OK in 81ms (Views: 78.7ms | ActiveRecord: 1.4ms)
18511
+ -------------------------------------------------------
18512
+ ClarkKent::ReportsControllerTest: test_should_get_index
18513
+ -------------------------------------------------------
18514
+ ClarkKent::Report Load (0.3ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
18515
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
18516
+ Processing by ClarkKent::ReportsController#index as HTML
18517
+ Parameters: {"current_user_id"=>"1"}
18518
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
18519
+ 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"]]
18520
+ Department Load (0.2ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
18521
+ 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"]]
18522
+ ClarkKent::Report Load (0.3ms) 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"]]
18523
+  (0.3ms) SELECT COUNT(*) FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" IS NULL
18524
+ Completed 200 OK in 14ms (Views: 12.7ms | ActiveRecord: 1.3ms)
18525
+ -----------------------------------------------------
18526
+ ClarkKent::ReportsControllerTest: test_should_get_new
18527
+ -----------------------------------------------------
18528
+ ClarkKent::Report Load (0.4ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
18529
+ User Load (0.6ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
18530
+ Processing by ClarkKent::ReportsController#new as HTML
18531
+ Parameters: {"current_user_id"=>"1"}
18532
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
18533
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
18534
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_edit.html.erb (41.0ms)
18535
+ Completed 200 OK in 46ms (Views: 45.4ms | ActiveRecord: 0.3ms)
18536
+ ---------------------------------------------------------
18537
+ ClarkKent::ReportsControllerTest: test_should_show_report
18538
+ ---------------------------------------------------------
18539
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
18540
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
18541
+ Processing by ClarkKent::ReportsController#show as HTML
18542
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
18543
+ 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
18544
+ 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
18545
+  (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"]]
18546
+  (0.4ms) 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"]]
18547
+  (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"]]
18548
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.9ms)
18549
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
18550
+ User Load (0.1ms) SELECT "users".* FROM "users"
18551
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (1.7ms)
18552
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.5ms)
18553
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (0.5ms)
18554
+ Completed 200 OK in 21ms (Views: 15.4ms | ActiveRecord: 1.3ms)
18555
+ -----------------------------------------------------------------
18556
+ ClarkKent::ReportsControllerTest: test_should_show_report_results
18557
+ -----------------------------------------------------------------
18558
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
18559
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
18560
+ Processing by ClarkKent::ReportsController#show as HTML
18561
+ Parameters: {"current_user_id"=>"1", "run_report"=>true, "created_at_until"=>"2015-04-27", "created_at_from"=>"2015-04-26", "id"=>"1"}
18562
+ 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
18563
+ 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
18564
+ 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"]]
18565
+ 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]]
18566
+ 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]]
18567
+  (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"]]
18568
+  (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"]]
18569
+  (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"]]
18570
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.5ms)
18571
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
18572
+ User Load (0.1ms) SELECT "users".* FROM "users"
18573
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (1.3ms)
18574
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.1ms)
18575
+  (0.1ms) SELECT COUNT(*) FROM "orders"
18576
+  (0.2ms) SELECT COUNT(count_column) FROM (SELECT "orders"."id" AS count_column FROM "orders" LIMIT 10 OFFSET 0) subquery_for_count
18577
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (5.1ms)
18578
+ 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]]
18579
+ Order Load (0.3ms) SELECT DISTINCT orders.id, orders.user_id, orders.amount, orders.description, orders.created_at, orders.updated_at,
18580
+ (SELECT u.name
18581
+ FROM users u
18582
+ WHERE u.id = orders.user_id)
18583
+ as user_name, NULL FROM "orders" LIMIT 10 OFFSET 0
18584
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
18585
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
18586
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
18587
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
18588
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_download_link.html.erb (1.1ms)
18589
+ Completed 200 OK in 30ms (Views: 21.9ms | ActiveRecord: 2.2ms)
18590
+ --------------------------------------------------------------------
18591
+ ClarkKent::ReportsControllerTest: test_should_show_report_run_errors
18592
+ --------------------------------------------------------------------
18593
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
18594
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
18595
+ Processing by ClarkKent::ReportsController#show as HTML
18596
+ Parameters: {"current_user_id"=>"1", "run_report"=>true, "id"=>"1"}
18597
+ 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
18598
+ 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
18599
+ 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"]]
18600
+ 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]]
18601
+ 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]]
18602
+  (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"]]
18603
+  (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"]]
18604
+  (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"]]
18605
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.2ms)
18606
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
18607
+ User Load (0.1ms) SELECT "users".* FROM "users"
18608
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (1.0ms)
18609
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.1ms)
18610
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (0.0ms)
18611
+ Completed 200 OK in 12ms (Views: 5.0ms | ActiveRecord: 1.3ms)
18612
+ -----------------------------------------------------------
18613
+ ClarkKent::ReportsControllerTest: test_should_update_report
18614
+ -----------------------------------------------------------
18615
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
18616
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
18617
+ Processing by ClarkKent::ReportsController#update as HTML
18618
+ Parameters: {"report"=>{"name"=>nil, "resource_type"=>"Order", "sharing_scope_id"=>"1", "sharing_scope_type"=>"Department"}, "current_user_id"=>"1", "id"=>"1"}
18619
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
18620
+  (0.1ms) begin transaction
18621
+  (0.1ms) commit transaction
18622
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
18623
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (2.3ms)
18624
+ Completed 200 OK in 5ms (Views: 2.7ms | ActiveRecord: 0.4ms)
18625
+ Order Load (0.2ms) SELECT "orders".* FROM "orders"
18626
+ Department Load (0.1ms) SELECT "departments".* FROM "departments"
18627
+  (1.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)) 
18628
+  (0.1ms) select sqlite_version(*)
18629
+  (1.0ms) CREATE INDEX "index_clark_kent_report_columns_on_report_id" ON "clark_kent_report_columns" ("report_id")
18630
+  (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))
18631
+  (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) 
18632
+  (0.8ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_id" ON "clark_kent_report_filters" ("filterable_id")
18633
+  (0.1ms)  SELECT sql
18634
+ FROM sqlite_master
18635
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
18636
+ UNION ALL
18637
+ SELECT sql
18638
+ FROM sqlite_temp_master
18639
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
18640
+ 
18641
+  (0.8ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_type" ON "clark_kent_report_filters" ("filterable_type")
18642
+  (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) 
18643
+  (1.1ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_id" ON "clark_kent_reports" ("sharing_scope_id")
18644
+  (0.1ms)  SELECT sql
18645
+ FROM sqlite_master
18646
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
18647
+ UNION ALL
18648
+ SELECT sql
18649
+ FROM sqlite_temp_master
18650
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
18651
+ 
18652
+  (1.0ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_type" ON "clark_kent_reports" ("sharing_scope_type")
18653
+  (1.1ms) CREATE TABLE "clark_kent_user_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "report_email_id" integer) 
18654
+  (1.1ms) CREATE TABLE "departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255))
18655
+  (1.1ms) CREATE TABLE "orders" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "amount" integer, "description" varchar(255), "created_at" datetime, "updated_at" datetime) 
18656
+  (1.1ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "email" varchar(255), "age" integer, "department_id" integer)
18657
+  (1.0ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
18658
+  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
18659
+  (0.1ms) SELECT version FROM "schema_migrations"
18660
+  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20150313144015')
18661
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170042')
18662
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170112')
18663
+  (1.1ms) INSERT INTO "schema_migrations" (version) VALUES ('20140114010048')
18664
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140129051754')
18665
+  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20150304233739')
18666
+  (0.1ms) begin transaction
18667
+ SQL (0.4ms) INSERT INTO "clark_kent_reports" ("created_at", "resource_type", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-04-27 19:41:27.305878"], ["resource_type", "Order"], ["updated_at", "2015-04-27 19:41:27.305878"]]
18668
+  (0.8ms) commit transaction
18669
+  (0.0ms) begin transaction
18670
+ SQL (0.9ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "user_name"], ["column_order", 1], ["report_id", 1]]
18671
+  (0.8ms) commit transaction
18672
+  (0.1ms) begin transaction
18673
+ 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]]
18674
+  (0.8ms) commit transaction
18675
+  (0.1ms) begin transaction
18676
+ SQL (0.4ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "amount"], ["column_order", 3], ["report_id", 1]]
18677
+  (0.8ms) commit transaction
18678
+  (0.2ms) begin transaction
18679
+ SQL (0.7ms) INSERT INTO "clark_kent_report_columns" ("column_name", "column_order", "report_id") VALUES (?, ?, ?) [["column_name", "description"], ["column_order", 4], ["report_id", 1]]
18680
+  (0.8ms) commit transaction
18681
+  (0.1ms) begin transaction
18682
+ SQL (0.4ms) INSERT INTO "departments" ("name") VALUES (?) [["name", "silly walks"]]
18683
+  (0.7ms) commit transaction
18684
+  (0.1ms) begin transaction
18685
+ SQL (0.3ms) INSERT INTO "users" ("department_id", "email", "name") VALUES (?, ?, ?) [["department_id", 1], ["email", "taproot@gmail.com"], ["name", "Michael Hedges"]]
18686
+  (0.6ms) commit transaction
18687
+  (0.1ms) begin transaction
18688
+ SQL (0.4ms) INSERT INTO "orders" ("amount", "created_at", "description", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["amount", 1], ["created_at", "2015-04-27 19:41:27.365156"], ["description", "Guitar strings"], ["updated_at", "2015-04-27 19:41:27.365156"], ["user_id", 1]]
18689
+  (0.7ms) commit transaction
18690
+ -------------------------
18691
+ ClarkKentTest: test_truth
18692
+ -------------------------
18693
+ ------------------------------------------------------------------------------------------------
18694
+ ClarkKent::ReportTest: test_can't_save_without_a_sharing_scope_id_if_the_sharing_scope_is_custom
18695
+ ------------------------------------------------------------------------------------------------
18696
+  (0.1ms) begin transaction
18697
+  (0.1ms) rollback transaction
18698
+ ---------------------------------------------------
18699
+ ClarkKent::ReportEmailTest: test_sends_report_to_s3
18700
+ ---------------------------------------------------
18701
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
18702
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
18703
+ SQL (2.3ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
18704
+  (0.1ms) begin transaction
18705
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
18706
+  (0.7ms) commit transaction
18707
+  (0.1ms) begin transaction
18708
+ SQL (0.7ms) 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-04-27 19:41:27.454455"], ["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-04-27 19:41:27.454455"]]
18709
+  (1.3ms) commit transaction
18710
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
18711
+ ClarkKent::Report Load (0.4ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
18712
+ 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"]]
18713
+ Department Load (0.2ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
18714
+ ClarkKent::ReportEmail Load (0.2ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."id" = ? LIMIT 1 [["id", 1]]
18715
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
18716
+ 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]]
18717
+ 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"]]
18718
+ 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"]]
18719
+ 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", 1]]
18720
+ 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", 1]]
18721
+ 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]]
18722
+ 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]]
18723
+  (0.2ms) SELECT COUNT(*) FROM "orders"
18724
+ -----------------------------------------------------------------------------------------
18725
+ ClarkKent::ReportEmailTest: test_throws_an_error_if_required_date_filters_are_not_present
18726
+ -----------------------------------------------------------------------------------------
18727
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
18728
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
18729
+ SQL (1.5ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
18730
+  (0.1ms) begin transaction
18731
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
18732
+  (0.7ms) commit transaction
18733
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
18734
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
18735
+ 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"]]
18736
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
18737
+ 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]]
18738
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
18739
+ 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]]
18740
+ 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"]]
18741
+ ClarkKent::ReportFilter Load (0.4ms) 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"]]
18742
+ 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]]
18743
+ 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]]
18744
+ -----------------------------------------------------------
18745
+ ClarkKent::ReportsControllerTest: test_should_create_report
18746
+ -----------------------------------------------------------
18747
+ ClarkKent::Report Load (0.3ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
18748
+ User Load (0.5ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
18749
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
18750
+ Processing by ClarkKent::ReportsController#create as HTML
18751
+ Parameters: {"report"=>{"name"=>"delete me", "resource_type"=>"Order", "sharing_scope_id"=>"1", "sharing_scope_type"=>"Department"}, "current_user_id"=>"1"}
18752
+  (0.1ms) begin transaction
18753
+ 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-04-27 19:41:27.606116"], ["name", "delete me"], ["resource_type", "Order"], ["sharing_scope_id", 1], ["sharing_scope_type", "Department"], ["updated_at", "2015-04-27 19:41:27.606116"]]
18754
+  (0.7ms) commit transaction
18755
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
18756
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (4.4ms)
18757
+ 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"]]
18758
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_index.html.erb (2.0ms)
18759
+ 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]]
18760
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_index.html.erb (3.0ms)
18761
+ 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]]
18762
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_index.html.erb (1.8ms)
18763
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/edit.html.erb within layouts/application (25.8ms)
18764
+ Completed 200 OK in 53ms (Views: 48.5ms | ActiveRecord: 1.6ms)
18765
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
18766
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."name" = 'delete me' LIMIT 1
18767
+  (0.0ms) begin transaction
18768
+ 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"]]
18769
+ 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]]
18770
+ 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]]
18771
+ SQL (0.7ms) DELETE FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? [["id", 2]]
18772
+  (1.3ms) commit transaction
18773
+ ------------------------------------------------------------
18774
+ ClarkKent::ReportsControllerTest: test_should_destroy_report
18775
+ ------------------------------------------------------------
18776
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
18777
+ User Load (0.5ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
18778
+  (0.0ms) begin transaction
18779
+ SQL (0.4ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-27 19:41:27.667295"], ["name", "delete me"], ["resource_type", "Order"], ["updated_at", "2015-04-27 19:41:27.667295"]]
18780
+  (0.7ms) commit transaction
18781
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
18782
+ Processing by ClarkKent::ReportsController#destroy as HTML
18783
+ Parameters: {"current_user_id"=>"1", "id"=>"3"}
18784
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 3]]
18785
+  (0.1ms) begin transaction
18786
+ 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"]]
18787
+ 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]]
18788
+ 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]]
18789
+ SQL (0.2ms) DELETE FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? [["id", 3]]
18790
+  (0.7ms) commit transaction
18791
+ Redirected to http://test.host/reports/reports
18792
+ Completed 302 Found in 6ms (ActiveRecord: 1.2ms)
18793
+  (0.2ms) SELECT COUNT(*) FROM "clark_kent_reports"
18794
+ ------------------------------------------------------
18795
+ ClarkKent::ReportsControllerTest: test_should_get_edit
18796
+ ------------------------------------------------------
18797
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
18798
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
18799
+ Processing by ClarkKent::ReportsController#edit as HTML
18800
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
18801
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
18802
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
18803
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (2.6ms)
18804
+ 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"]]
18805
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_index.html.erb (1.7ms)
18806
+ 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]]
18807
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (1.1ms)
18808
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (2.9ms)
18809
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.4ms)
18810
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.6ms)
18811
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.7ms)
18812
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (1.0ms)
18813
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (1.1ms)
18814
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (1.5ms)
18815
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_index.html.erb (10.6ms)
18816
+ 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]]
18817
+ 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"]]
18818
+ 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]]
18819
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show.html.erb (19.1ms)
18820
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show_wrapper.html.erb (20.7ms)
18821
+ 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"]]
18822
+ 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]]
18823
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show.html.erb (37.7ms)
18824
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show_wrapper.html.erb (38.0ms)
18825
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_index.html.erb (61.8ms)
18826
+ Completed 200 OK in 82ms (Views: 79.4ms | ActiveRecord: 1.4ms)
18827
+ -------------------------------------------------------
18828
+ ClarkKent::ReportsControllerTest: test_should_get_index
18829
+ -------------------------------------------------------
18830
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
18831
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
18832
+ Processing by ClarkKent::ReportsController#index as HTML
18833
+ Parameters: {"current_user_id"=>"1"}
18834
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
18835
+ ClarkKent::Report Exists (0.4ms) 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"]]
18836
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
18837
+ 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"]]
18838
+ 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"]]
18839
+  (0.2ms) SELECT COUNT(*) FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" IS NULL
18840
+ Completed 200 OK in 20ms (Views: 18.6ms | ActiveRecord: 1.2ms)
18841
+ -----------------------------------------------------
18842
+ ClarkKent::ReportsControllerTest: test_should_get_new
18843
+ -----------------------------------------------------
18844
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
18845
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
18846
+ Processing by ClarkKent::ReportsController#new as HTML
18847
+ Parameters: {"current_user_id"=>"1"}
18848
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
18849
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
18850
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_edit.html.erb (56.2ms)
18851
+ Completed 200 OK in 64ms (Views: 62.9ms | ActiveRecord: 0.3ms)
18852
+ ---------------------------------------------------------
18853
+ ClarkKent::ReportsControllerTest: test_should_show_report
18854
+ ---------------------------------------------------------
18855
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
18856
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
18857
+ Processing by ClarkKent::ReportsController#show as HTML
18858
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
18859
+ 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
18860
+ ClarkKent::ReportColumn Load (0.6ms) 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
18861
+  (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"]]
18862
+  (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"]]
18863
+  (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"]]
18864
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.8ms)
18865
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
18866
+ User Load (0.1ms) SELECT "users".* FROM "users"
18867
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (1.9ms)
18868
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.8ms)
18869
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (1.0ms)
18870
+ Completed 200 OK in 26ms (Views: 18.0ms | ActiveRecord: 1.3ms)
18871
+ -----------------------------------------------------------------
18872
+ ClarkKent::ReportsControllerTest: test_should_show_report_results
18873
+ -----------------------------------------------------------------
18874
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
18875
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
18876
+ Processing by ClarkKent::ReportsController#show as HTML
18877
+ Parameters: {"current_user_id"=>"1", "run_report"=>true, "created_at_until"=>"2015-04-27", "created_at_from"=>"2015-04-26", "id"=>"1"}
18878
+ 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
18879
+ 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
18880
+ 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"]]
18881
+ 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]]
18882
+ 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]]
18883
+  (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"]]
18884
+  (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"]]
18885
+  (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"]]
18886
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.7ms)
18887
+ User Load (0.3ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
18888
+ User Load (0.2ms) SELECT "users".* FROM "users"
18889
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (2.7ms)
18890
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.2ms)
18891
+  (0.1ms) SELECT COUNT(*) FROM "orders"
18892
+  (0.3ms) SELECT COUNT(count_column) FROM (SELECT "orders"."id" AS count_column FROM "orders" LIMIT 10 OFFSET 0) subquery_for_count
18893
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (5.1ms)
18894
+ 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]]
18895
+ Order Load (0.7ms) SELECT DISTINCT orders.id, orders.user_id, orders.amount, orders.description, orders.created_at, orders.updated_at,
18896
+ (SELECT u.name
18897
+ FROM users u
18898
+ WHERE u.id = orders.user_id)
18899
+ as user_name, NULL FROM "orders" LIMIT 10 OFFSET 0
18900
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
18901
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
18902
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
18903
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
18904
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_download_link.html.erb (1.2ms)
18905
+ Completed 200 OK in 40ms (Views: 30.2ms | ActiveRecord: 3.4ms)
18906
+ --------------------------------------------------------------------
18907
+ ClarkKent::ReportsControllerTest: test_should_show_report_run_errors
18908
+ --------------------------------------------------------------------
18909
+ ClarkKent::Report Load (0.4ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
18910
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
18911
+ Processing by ClarkKent::ReportsController#show as HTML
18912
+ Parameters: {"current_user_id"=>"1", "run_report"=>true, "id"=>"1"}
18913
+ 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
18914
+ 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
18915
+ 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"]]
18916
+ 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]]
18917
+ 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]]
18918
+  (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"]]
18919
+  (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"]]
18920
+  (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"]]
18921
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.3ms)
18922
+ User Load (0.3ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
18923
+ User Load (0.2ms) SELECT "users".* FROM "users"
18924
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (3.0ms)
18925
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.1ms)
18926
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (0.1ms)
18927
+ Completed 200 OK in 16ms (Views: 8.6ms | ActiveRecord: 1.7ms)
18928
+ -----------------------------------------------------------
18929
+ ClarkKent::ReportsControllerTest: test_should_update_report
18930
+ -----------------------------------------------------------
18931
+ ClarkKent::Report Load (0.5ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
18932
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
18933
+ Processing by ClarkKent::ReportsController#update as HTML
18934
+ Parameters: {"report"=>{"name"=>nil, "resource_type"=>"Order", "sharing_scope_id"=>"1", "sharing_scope_type"=>"Department"}, "current_user_id"=>"1", "id"=>"1"}
18935
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
18936
+  (0.1ms) begin transaction
18937
+  (0.1ms) commit transaction
18938
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
18939
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (3.0ms)
18940
+ Completed 200 OK in 8ms (Views: 3.9ms | ActiveRecord: 0.4ms)
18941
+  (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)) 
18942
+  (0.1ms) select sqlite_version(*)
18943
+  (1.1ms) CREATE INDEX "index_clark_kent_report_columns_on_report_id" ON "clark_kent_report_columns" ("report_id")
18944
+  (1.0ms) CREATE TABLE "clark_kent_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "when_to_send" varchar(255), "name" varchar(255))
18945
+  (1.2ms) 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) 
18946
+  (1.2ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_id" ON "clark_kent_report_filters" ("filterable_id")
18947
+  (0.1ms)  SELECT sql
18948
+ FROM sqlite_master
18949
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
18950
+ UNION ALL
18951
+ SELECT sql
18952
+ FROM sqlite_temp_master
18953
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
18954
+ 
18955
+  (0.9ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_type" ON "clark_kent_report_filters" ("filterable_type")
18956
+  (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) 
18957
+  (1.2ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_id" ON "clark_kent_reports" ("sharing_scope_id")
18958
+  (0.1ms)  SELECT sql
18959
+ FROM sqlite_master
18960
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
18961
+ UNION ALL
18962
+ SELECT sql
18963
+ FROM sqlite_temp_master
18964
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
18965
+ 
18966
+  (1.0ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_type" ON "clark_kent_reports" ("sharing_scope_type")
18967
+  (1.1ms) CREATE TABLE "clark_kent_user_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "report_email_id" integer) 
18968
+  (1.0ms) CREATE TABLE "departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255))
18969
+  (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) 
18970
+  (1.1ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "email" varchar(255), "age" integer, "department_id" integer)
18971
+  (1.0ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
18972
+  (0.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
18973
+  (0.1ms) SELECT version FROM "schema_migrations"
18974
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20150313144015')
18975
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170042')
18976
+  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170112')
18977
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140114010048')
18978
+  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20140129051754')
18979
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20150304233739')
18980
+  (0.1ms) begin transaction
18981
+ SQL (0.5ms) INSERT INTO "clark_kent_reports" ("created_at", "resource_type", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-04-27 19:41:57.524570"], ["resource_type", "Order"], ["updated_at", "2015-04-27 19:41:57.524570"]]
18982
+  (2.2ms) commit transaction
18983
+  (0.1ms) begin transaction
18984
+ 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]]
18985
+  (0.8ms) commit transaction
18986
+  (0.1ms) begin transaction
18987
+ 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]]
18988
+  (0.7ms) commit transaction
18989
+  (0.0ms) begin transaction
18990
+ 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]]
18991
+  (0.8ms) commit transaction
18992
+  (0.0ms) begin transaction
18993
+ 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]]
18994
+  (0.7ms) commit transaction
18995
+  (0.1ms) begin transaction
18996
+ SQL (0.4ms) INSERT INTO "departments" ("name") VALUES (?) [["name", "silly walks"]]
18997
+  (0.8ms) commit transaction
18998
+  (0.0ms) begin transaction
18999
+ SQL (0.3ms) INSERT INTO "users" ("department_id", "email", "name") VALUES (?, ?, ?) [["department_id", 1], ["email", "taproot@gmail.com"], ["name", "Michael Hedges"]]
19000
+  (0.7ms) commit transaction
19001
+  (0.1ms) begin transaction
19002
+ SQL (0.4ms) INSERT INTO "orders" ("amount", "created_at", "description", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["amount", 1], ["created_at", "2015-04-27 19:41:57.583618"], ["description", "Guitar strings"], ["updated_at", "2015-04-27 19:41:57.583618"], ["user_id", 1]]
19003
+  (0.7ms) commit transaction
19004
+ ---------------------------------------------------
19005
+ ClarkKent::ReportEmailTest: test_sends_report_to_s3
19006
+ ---------------------------------------------------
19007
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
19008
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
19009
+ SQL (1.0ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
19010
+  (0.1ms) begin transaction
19011
+ SQL (0.4ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
19012
+  (0.8ms) commit transaction
19013
+  (0.0ms) begin transaction
19014
+ 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-04-27 19:41:57.660348"], ["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-04-27 19:41:57.660348"]]
19015
+  (0.8ms) commit transaction
19016
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
19017
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
19018
+ 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"]]
19019
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
19020
+ 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]]
19021
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
19022
+ 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]]
19023
+ 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"]]
19024
+ 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"]]
19025
+ 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]]
19026
+ 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]]
19027
+ 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]]
19028
+ 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]]
19029
+  (0.2ms) SELECT COUNT(*) FROM "orders"
19030
+ -----------------------------------------------------------------------------------------
19031
+ ClarkKent::ReportEmailTest: test_throws_an_error_if_required_date_filters_are_not_present
19032
+ -----------------------------------------------------------------------------------------
19033
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
19034
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
19035
+ SQL (1.1ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
19036
+  (0.1ms) begin transaction
19037
+ SQL (0.2ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
19038
+  (0.7ms) commit transaction
19039
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
19040
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
19041
+ 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"]]
19042
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
19043
+ 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]]
19044
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
19045
+ 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]]
19046
+ 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"]]
19047
+ 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"]]
19048
+ 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]]
19049
+ 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]]
19050
+ -------------------------
19051
+ ClarkKentTest: test_truth
19052
+ -------------------------
19053
+ ------------------------------------------------------------------------------------------------
19054
+ ClarkKent::ReportTest: test_can't_save_without_a_sharing_scope_id_if_the_sharing_scope_is_custom
19055
+ ------------------------------------------------------------------------------------------------
19056
+  (0.1ms) begin transaction
19057
+  (0.1ms) rollback transaction
19058
+ -----------------------------------------------------------
19059
+ ClarkKent::ReportsControllerTest: test_should_create_report
19060
+ -----------------------------------------------------------
19061
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
19062
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
19063
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
19064
+ Processing by ClarkKent::ReportsController#create as HTML
19065
+ Parameters: {"report"=>{"name"=>"delete me", "resource_type"=>"Order", "sharing_scope_id"=>"1", "sharing_scope_type"=>"Department"}, "current_user_id"=>"1"}
19066
+  (0.1ms) begin transaction
19067
+ 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-04-27 19:41:57.807655"], ["name", "delete me"], ["resource_type", "Order"], ["sharing_scope_id", 1], ["sharing_scope_type", "Department"], ["updated_at", "2015-04-27 19:41:57.807655"]]
19068
+  (1.0ms) commit transaction
19069
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
19070
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (3.3ms)
19071
+ 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"]]
19072
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_index.html.erb (2.4ms)
19073
+ 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]]
19074
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_index.html.erb (2.4ms)
19075
+ 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]]
19076
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_index.html.erb (1.9ms)
19077
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/edit.html.erb within layouts/application (17.9ms)
19078
+ Completed 200 OK in 43ms (Views: 38.7ms | ActiveRecord: 2.0ms)
19079
+  (0.2ms) SELECT COUNT(*) FROM "clark_kent_reports"
19080
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."name" = 'delete me' LIMIT 1
19081
+  (0.0ms) begin transaction
19082
+ 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"]]
19083
+ 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]]
19084
+ 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]]
19085
+ SQL (0.3ms) DELETE FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? [["id", 2]]
19086
+  (0.7ms) commit transaction
19087
+ ------------------------------------------------------------
19088
+ ClarkKent::ReportsControllerTest: test_should_destroy_report
19089
+ ------------------------------------------------------------
19090
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
19091
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
19092
+  (0.0ms) begin transaction
19093
+ SQL (0.4ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-27 19:41:57.857369"], ["name", "delete me"], ["resource_type", "Order"], ["updated_at", "2015-04-27 19:41:57.857369"]]
19094
+  (1.2ms) commit transaction
19095
+  (0.2ms) SELECT COUNT(*) FROM "clark_kent_reports"
19096
+ Processing by ClarkKent::ReportsController#destroy as HTML
19097
+ Parameters: {"current_user_id"=>"1", "id"=>"3"}
19098
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 3]]
19099
+  (0.1ms) begin transaction
19100
+ 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"]]
19101
+ 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]]
19102
+ ClarkKent::ReportEmail Load (0.2ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 3]]
19103
+ SQL (0.3ms) DELETE FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? [["id", 3]]
19104
+  (0.8ms) commit transaction
19105
+ Redirected to http://test.host/reports/reports
19106
+ Completed 302 Found in 7ms (ActiveRecord: 1.6ms)
19107
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
19108
+ ------------------------------------------------------
19109
+ ClarkKent::ReportsControllerTest: test_should_get_edit
19110
+ ------------------------------------------------------
19111
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
19112
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
19113
+ Processing by ClarkKent::ReportsController#edit as HTML
19114
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
19115
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
19116
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
19117
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (1.4ms)
19118
+ 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"]]
19119
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_index.html.erb (1.4ms)
19120
+ 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]]
19121
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (1.1ms)
19122
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (2.9ms)
19123
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.7ms)
19124
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.9ms)
19125
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.3ms)
19126
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.5ms)
19127
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.6ms)
19128
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.7ms)
19129
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_index.html.erb (8.3ms)
19130
+ 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]]
19131
+ ClarkKent::ReportDateFilter Load (0.3ms) 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"]]
19132
+ 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]]
19133
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show.html.erb (53.3ms)
19134
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show_wrapper.html.erb (54.5ms)
19135
+ 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"]]
19136
+ 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]]
19137
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show.html.erb (2.7ms)
19138
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show_wrapper.html.erb (2.9ms)
19139
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_index.html.erb (59.8ms)
19140
+ Completed 200 OK in 75ms (Views: 72.5ms | ActiveRecord: 1.3ms)
19141
+ -------------------------------------------------------
19142
+ ClarkKent::ReportsControllerTest: test_should_get_index
19143
+ -------------------------------------------------------
19144
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
19145
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
19146
+ Processing by ClarkKent::ReportsController#index as HTML
19147
+ Parameters: {"current_user_id"=>"1"}
19148
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
19149
+ 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"]]
19150
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
19151
+ 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"]]
19152
+ 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"]]
19153
+  (0.2ms) SELECT COUNT(*) FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" IS NULL
19154
+ Completed 200 OK in 13ms (Views: 11.9ms | ActiveRecord: 0.9ms)
19155
+ -----------------------------------------------------
19156
+ ClarkKent::ReportsControllerTest: test_should_get_new
19157
+ -----------------------------------------------------
19158
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
19159
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
19160
+ Processing by ClarkKent::ReportsController#new as HTML
19161
+ Parameters: {"current_user_id"=>"1"}
19162
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
19163
+ Department Load (0.3ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
19164
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_edit.html.erb (53.4ms)
19165
+ Completed 200 OK in 59ms (Views: 57.9ms | ActiveRecord: 0.6ms)
19166
+ ---------------------------------------------------------
19167
+ ClarkKent::ReportsControllerTest: test_should_show_report
19168
+ ---------------------------------------------------------
19169
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
19170
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
19171
+ Processing by ClarkKent::ReportsController#show as HTML
19172
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
19173
+ 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
19174
+ ClarkKent::ReportColumn Load (0.3ms) 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
19175
+  (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"]]
19176
+  (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"]]
19177
+  (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"]]
19178
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.9ms)
19179
+ User Load (0.3ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
19180
+ User Load (0.1ms) SELECT "users".* FROM "users"
19181
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (2.4ms)
19182
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.7ms)
19183
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (0.8ms)
19184
+ Completed 200 OK in 22ms (Views: 15.3ms | ActiveRecord: 1.2ms)
19185
+ -----------------------------------------------------------------
19186
+ ClarkKent::ReportsControllerTest: test_should_show_report_results
19187
+ -----------------------------------------------------------------
19188
+ ClarkKent::Report Load (0.3ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
19189
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
19190
+ Processing by ClarkKent::ReportsController#show as HTML
19191
+ Parameters: {"current_user_id"=>"1", "run_report"=>true, "created_at_until"=>"2015-04-27", "created_at_from"=>"2015-04-26", "id"=>"1"}
19192
+ 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
19193
+ 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
19194
+ 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"]]
19195
+ 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]]
19196
+ 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]]
19197
+  (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"]]
19198
+  (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"]]
19199
+  (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"]]
19200
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.4ms)
19201
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
19202
+ User Load (0.1ms) SELECT "users".* FROM "users"
19203
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (1.4ms)
19204
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.1ms)
19205
+  (0.2ms) SELECT COUNT(*) FROM "orders"
19206
+  (0.2ms) SELECT COUNT(count_column) FROM (SELECT "orders"."id" AS count_column FROM "orders" LIMIT 10 OFFSET 0) subquery_for_count
19207
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (5.0ms)
19208
+ 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]]
19209
+ Order Load (0.1ms) SELECT DISTINCT orders.id, orders.user_id, orders.amount, orders.description, orders.created_at, orders.updated_at,
19210
+ (SELECT u.name
19211
+ FROM users u
19212
+ WHERE u.id = orders.user_id)
19213
+ as user_name, NULL FROM "orders" LIMIT 10 OFFSET 0
19214
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
19215
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
19216
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
19217
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
19218
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_download_link.html.erb (1.2ms)
19219
+ Completed 200 OK in 30ms (Views: 21.9ms | ActiveRecord: 2.4ms)
19220
+ --------------------------------------------------------------------
19221
+ ClarkKent::ReportsControllerTest: test_should_show_report_run_errors
19222
+ --------------------------------------------------------------------
19223
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
19224
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
19225
+ Processing by ClarkKent::ReportsController#show as HTML
19226
+ Parameters: {"current_user_id"=>"1", "run_report"=>true, "id"=>"1"}
19227
+ 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
19228
+ 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
19229
+ 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"]]
19230
+ 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]]
19231
+ 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]]
19232
+  (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"]]
19233
+  (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"]]
19234
+  (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"]]
19235
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.3ms)
19236
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
19237
+ User Load (0.1ms) SELECT "users".* FROM "users"
19238
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (1.6ms)
19239
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.1ms)
19240
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (0.1ms)
19241
+ Completed 200 OK in 14ms (Views: 6.7ms | ActiveRecord: 1.5ms)
19242
+ -----------------------------------------------------------
19243
+ ClarkKent::ReportsControllerTest: test_should_update_report
19244
+ -----------------------------------------------------------
19245
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
19246
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
19247
+ Processing by ClarkKent::ReportsController#update as HTML
19248
+ Parameters: {"report"=>{"name"=>nil, "resource_type"=>"Order", "sharing_scope_id"=>"1", "sharing_scope_type"=>"Department"}, "current_user_id"=>"1", "id"=>"1"}
19249
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
19250
+  (0.1ms) begin transaction
19251
+  (0.1ms) commit transaction
19252
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
19253
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (2.0ms)
19254
+ Completed 200 OK in 5ms (Views: 2.4ms | ActiveRecord: 0.3ms)
19255
+  (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)) 
19256
+  (0.1ms) select sqlite_version(*)
19257
+  (1.4ms) CREATE INDEX "index_clark_kent_report_columns_on_report_id" ON "clark_kent_report_columns" ("report_id")
19258
+  (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))
19259
+  (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) 
19260
+  (0.9ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_id" ON "clark_kent_report_filters" ("filterable_id")
19261
+  (0.1ms)  SELECT sql
19262
+ FROM sqlite_master
19263
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
19264
+ UNION ALL
19265
+ SELECT sql
19266
+ FROM sqlite_temp_master
19267
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
19268
+ 
19269
+  (1.0ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_type" ON "clark_kent_report_filters" ("filterable_type")
19270
+  (1.4ms) 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) 
19271
+  (1.1ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_id" ON "clark_kent_reports" ("sharing_scope_id")
19272
+  (0.1ms)  SELECT sql
19273
+ FROM sqlite_master
19274
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
19275
+ UNION ALL
19276
+ SELECT sql
19277
+ FROM sqlite_temp_master
19278
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
19279
+ 
19280
+  (0.8ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_type" ON "clark_kent_reports" ("sharing_scope_type")
19281
+  (0.8ms) CREATE TABLE "clark_kent_user_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "report_email_id" integer) 
19282
+  (0.8ms) CREATE TABLE "departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255))
19283
+  (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) 
19284
+  (1.1ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "email" varchar(255), "age" integer, "department_id" integer)
19285
+  (1.3ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
19286
+  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
19287
+  (0.1ms) SELECT version FROM "schema_migrations"
19288
+  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES ('20150313144015')
19289
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170042')
19290
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170112')
19291
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140114010048')
19292
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140129051754')
19293
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150304233739')
19294
+  (0.1ms) begin transaction
19295
+ SQL (0.5ms) INSERT INTO "clark_kent_reports" ("created_at", "resource_type", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-04-27 19:42:32.497953"], ["resource_type", "Order"], ["updated_at", "2015-04-27 19:42:32.497953"]]
19296
+  (0.8ms) commit transaction
19297
+  (0.1ms) begin transaction
19298
+ 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]]
19299
+  (0.7ms) commit transaction
19300
+  (0.1ms) begin transaction
19301
+ 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]]
19302
+  (0.6ms) commit transaction
19303
+  (0.0ms) begin transaction
19304
+ 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]]
19305
+  (0.7ms) commit transaction
19306
+  (0.0ms) begin transaction
19307
+ 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]]
19308
+  (0.6ms) commit transaction
19309
+  (0.1ms) begin transaction
19310
+ SQL (0.5ms) INSERT INTO "departments" ("name") VALUES (?) [["name", "silly walks"]]
19311
+  (0.9ms) commit transaction
19312
+  (0.0ms) begin transaction
19313
+ SQL (0.3ms) INSERT INTO "users" ("department_id", "email", "name") VALUES (?, ?, ?) [["department_id", 1], ["email", "taproot@gmail.com"], ["name", "Michael Hedges"]]
19314
+  (0.8ms) commit transaction
19315
+  (0.1ms) begin transaction
19316
+ SQL (0.4ms) INSERT INTO "orders" ("amount", "created_at", "description", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["amount", 1], ["created_at", "2015-04-27 19:42:32.549088"], ["description", "Guitar strings"], ["updated_at", "2015-04-27 19:42:32.549088"], ["user_id", 1]]
19317
+  (0.7ms) commit transaction
19318
+ ------------------------------------------------------------------------------------------------
19319
+ ClarkKent::ReportTest: test_can't_save_without_a_sharing_scope_id_if_the_sharing_scope_is_custom
19320
+ ------------------------------------------------------------------------------------------------
19321
+  (0.1ms) begin transaction
19322
+  (0.1ms) rollback transaction
19323
+ -------------------------
19324
+ ClarkKentTest: test_truth
19325
+ -------------------------
19326
+ -----------------------------------------------------------
19327
+ ClarkKent::ReportsControllerTest: test_should_create_report
19328
+ -----------------------------------------------------------
19329
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
19330
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
19331
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
19332
+ Processing by ClarkKent::ReportsController#create as HTML
19333
+ Parameters: {"report"=>{"name"=>"delete me", "resource_type"=>"Order", "sharing_scope_id"=>nil, "sharing_scope_type"=>nil}, "current_user_id"=>"1"}
19334
+  (0.1ms) begin transaction
19335
+ SQL (0.6ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-27 19:42:32.630360"], ["name", "delete me"], ["resource_type", "Order"], ["updated_at", "2015-04-27 19:42:32.630360"]]
19336
+  (0.9ms) commit transaction
19337
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (20.3ms)
19338
+ 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"]]
19339
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_index.html.erb (5.0ms)
19340
+ 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]]
19341
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_index.html.erb (1.7ms)
19342
+ 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]]
19343
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_index.html.erb (7.2ms)
19344
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/edit.html.erb within layouts/application (41.8ms)
19345
+ Completed 200 OK in 67ms (Views: 60.5ms | ActiveRecord: 2.4ms)
19346
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
19347
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."name" = 'delete me' LIMIT 1
19348
+  (0.0ms) begin transaction
19349
+ 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"]]
19350
+ 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]]
19351
+ 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]]
19352
+ SQL (0.4ms) DELETE FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? [["id", 2]]
19353
+  (0.7ms) commit transaction
19354
+ ------------------------------------------------------------
19355
+ ClarkKent::ReportsControllerTest: test_should_destroy_report
19356
+ ------------------------------------------------------------
19357
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
19358
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
19359
+  (0.1ms) begin transaction
19360
+ SQL (0.3ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-27 19:42:32.706349"], ["name", "delete me"], ["resource_type", "Order"], ["updated_at", "2015-04-27 19:42:32.706349"]]
19361
+  (0.8ms) commit transaction
19362
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
19363
+ Processing by ClarkKent::ReportsController#destroy as HTML
19364
+ Parameters: {"current_user_id"=>"1", "id"=>"3"}
19365
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 3]]
19366
+  (0.1ms) begin transaction
19367
+ 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"]]
19368
+ 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]]
19369
+ ClarkKent::ReportEmail Load (0.1ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 3]]
19370
+ SQL (0.9ms) DELETE FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? [["id", 3]]
19371
+  (0.7ms) commit transaction
19372
+ Redirected to http://test.host/reports/reports
19373
+ Completed 302 Found in 7ms (ActiveRecord: 2.2ms)
19374
+  (0.2ms) SELECT COUNT(*) FROM "clark_kent_reports"
19375
+ ------------------------------------------------------
19376
+ ClarkKent::ReportsControllerTest: test_should_get_edit
19377
+ ------------------------------------------------------
19378
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
19379
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
19380
+ Processing by ClarkKent::ReportsController#edit as HTML
19381
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
19382
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
19383
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (0.8ms)
19384
+ 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"]]
19385
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_index.html.erb (1.3ms)
19386
+ 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]]
19387
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (1.0ms)
19388
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (2.8ms)
19389
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.3ms)
19390
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.5ms)
19391
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.4ms)
19392
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.6ms)
19393
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.3ms)
19394
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.5ms)
19395
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_index.html.erb (7.4ms)
19396
+ 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]]
19397
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_index.html.erb (1.3ms)
19398
+ Completed 200 OK in 15ms (Views: 13.8ms | ActiveRecord: 0.4ms)
19399
+ -------------------------------------------------------
19400
+ ClarkKent::ReportsControllerTest: test_should_get_index
19401
+ -------------------------------------------------------
19402
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
19403
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
19404
+ Processing by ClarkKent::ReportsController#index as HTML
19405
+ Parameters: {"current_user_id"=>"1"}
19406
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
19407
+ 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"]]
19408
+ Department Load (0.2ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
19409
+ 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"]]
19410
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" IS NULL
19411
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" IS NULL
19412
+ Completed 200 OK in 20ms (Views: 19.0ms | ActiveRecord: 0.8ms)
19413
+ -----------------------------------------------------
19414
+ ClarkKent::ReportsControllerTest: test_should_get_new
19415
+ -----------------------------------------------------
19416
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
19417
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
19418
+ Processing by ClarkKent::ReportsController#new as HTML
19419
+ Parameters: {"current_user_id"=>"1"}
19420
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
19421
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
19422
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_edit.html.erb (42.7ms)
19423
+ Completed 200 OK in 48ms (Views: 47.0ms | ActiveRecord: 0.3ms)
19424
+ ---------------------------------------------------------
19425
+ ClarkKent::ReportsControllerTest: test_should_show_report
19426
+ ---------------------------------------------------------
19427
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
19428
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
19429
+ Processing by ClarkKent::ReportsController#show as HTML
19430
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
19431
+ 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
19432
+ 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
19433
+  (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"]]
19434
+  (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"]]
19435
+  (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"]]
19436
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (3.2ms)
19437
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
19438
+ User Load (0.1ms) SELECT "users".* FROM "users"
19439
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (2.0ms)
19440
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.5ms)
19441
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (0.7ms)
19442
+ Completed 200 OK in 26ms (Views: 19.7ms | ActiveRecord: 1.2ms)
19443
+ -----------------------------------------------------------------
19444
+ ClarkKent::ReportsControllerTest: test_should_show_report_results
19445
+ -----------------------------------------------------------------
19446
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
19447
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
19448
+ Processing by ClarkKent::ReportsController#show as HTML
19449
+ Parameters: {"current_user_id"=>"1", "run_report"=>true, "created_at_until"=>"2015-04-27", "created_at_from"=>"2015-04-26", "id"=>"1"}
19450
+ 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
19451
+ 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
19452
+ 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"]]
19453
+ 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]]
19454
+  (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"]]
19455
+  (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"]]
19456
+  (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"]]
19457
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.6ms)
19458
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
19459
+ User Load (0.1ms) SELECT "users".* FROM "users"
19460
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (1.5ms)
19461
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.1ms)
19462
+  (0.1ms) SELECT COUNT(*) FROM "orders"
19463
+  (0.2ms) SELECT COUNT(count_column) FROM (SELECT "orders"."id" AS count_column FROM "orders" LIMIT 10 OFFSET 0) subquery_for_count
19464
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (4.8ms)
19465
+ 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]]
19466
+ Order Load (0.2ms) SELECT DISTINCT orders.id, orders.user_id, orders.amount, orders.description, orders.created_at, orders.updated_at,
19467
+ (SELECT u.name
19468
+ FROM users u
19469
+ WHERE u.id = orders.user_id)
19470
+ as user_name, NULL FROM "orders" LIMIT 10 OFFSET 0
19471
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
19472
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
19473
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
19474
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
19475
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_download_link.html.erb (1.3ms)
19476
+ Completed 200 OK in 30ms (Views: 22.9ms | ActiveRecord: 2.3ms)
19477
+ --------------------------------------------------------------------
19478
+ ClarkKent::ReportsControllerTest: test_should_show_report_run_errors
19479
+ --------------------------------------------------------------------
19480
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
19481
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
19482
+ Processing by ClarkKent::ReportsController#show as HTML
19483
+ Parameters: {"current_user_id"=>"1", "run_report"=>true, "id"=>"1"}
19484
+ 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
19485
+ 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
19486
+ 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"]]
19487
+ 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]]
19488
+  (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"]]
19489
+  (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"]]
19490
+  (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"]]
19491
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.8ms)
19492
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
19493
+ User Load (0.1ms) SELECT "users".* FROM "users"
19494
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (1.4ms)
19495
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.1ms)
19496
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (0.0ms)
19497
+ Completed 200 OK in 46ms (Views: 39.7ms | ActiveRecord: 1.1ms)
19498
+ -----------------------------------------------------------
19499
+ ClarkKent::ReportsControllerTest: test_should_update_report
19500
+ -----------------------------------------------------------
19501
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
19502
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
19503
+ Processing by ClarkKent::ReportsController#update as HTML
19504
+ Parameters: {"report"=>{"name"=>nil, "resource_type"=>"Order", "sharing_scope_id"=>nil, "sharing_scope_type"=>nil}, "current_user_id"=>"1", "id"=>"1"}
19505
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
19506
+  (0.0ms) begin transaction
19507
+  (0.0ms) commit transaction
19508
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (0.8ms)
19509
+ Completed 200 OK in 3ms (Views: 1.1ms | ActiveRecord: 0.1ms)
19510
+ ---------------------------------------------------
19511
+ ClarkKent::ReportEmailTest: test_sends_report_to_s3
19512
+ ---------------------------------------------------
19513
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
19514
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
19515
+ SQL (1.5ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
19516
+  (0.1ms) begin transaction
19517
+ SQL (0.4ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
19518
+  (0.8ms) commit transaction
19519
+  (0.1ms) begin transaction
19520
+ 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-04-27 19:42:32.957763"], ["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-04-27 19:42:32.957763"]]
19521
+  (0.9ms) commit transaction
19522
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
19523
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
19524
+ 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"]]
19525
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
19526
+ 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]]
19527
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
19528
+ 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]]
19529
+ 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"]]
19530
+ 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"]]
19531
+ 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]]
19532
+ 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]]
19533
+ 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]]
19534
+ 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]]
19535
+  (0.1ms) SELECT COUNT(*) FROM "orders"
19536
+ -----------------------------------------------------------------------------------------
19537
+ ClarkKent::ReportEmailTest: test_throws_an_error_if_required_date_filters_are_not_present
19538
+ -----------------------------------------------------------------------------------------
19539
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
19540
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
19541
+ SQL (0.9ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
19542
+  (0.1ms) begin transaction
19543
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
19544
+  (0.6ms) commit transaction
19545
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
19546
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
19547
+ 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"]]
19548
+ Department Load (0.2ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
19549
+ ClarkKent::ReportEmail Load (0.2ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."id" = ? LIMIT 1 [["id", 2]]
19550
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
19551
+ 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]]
19552
+ 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"]]
19553
+ 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"]]
19554
+ 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]]
19555
+ 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]]
19556
+  (1.2ms) 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)) 
19557
+  (0.1ms) select sqlite_version(*)
19558
+  (1.3ms) CREATE INDEX "index_clark_kent_report_columns_on_report_id" ON "clark_kent_report_columns" ("report_id")
19559
+  (1.0ms) CREATE TABLE "clark_kent_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "when_to_send" varchar(255), "name" varchar(255))
19560
+  (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) 
19561
+  (1.0ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_id" ON "clark_kent_report_filters" ("filterable_id")
19562
+  (0.1ms)  SELECT sql
19563
+ FROM sqlite_master
19564
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
19565
+ UNION ALL
19566
+ SELECT sql
19567
+ FROM sqlite_temp_master
19568
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
19569
+ 
19570
+  (0.9ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_type" ON "clark_kent_report_filters" ("filterable_type")
19571
+  (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) 
19572
+  (1.0ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_id" ON "clark_kent_reports" ("sharing_scope_id")
19573
+  (0.1ms)  SELECT sql
19574
+ FROM sqlite_master
19575
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
19576
+ UNION ALL
19577
+ SELECT sql
19578
+ FROM sqlite_temp_master
19579
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
19580
+ 
19581
+  (0.8ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_type" ON "clark_kent_reports" ("sharing_scope_type")
19582
+  (0.9ms) CREATE TABLE "clark_kent_user_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "report_email_id" integer) 
19583
+  (0.9ms) CREATE TABLE "departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255))
19584
+  (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) 
19585
+  (0.8ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "email" varchar(255), "age" integer, "department_id" integer)
19586
+  (1.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
19587
+  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
19588
+  (0.1ms) SELECT version FROM "schema_migrations"
19589
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150313144015')
19590
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170042')
19591
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20131226170112')
19592
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140114010048')
19593
+  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140129051754')
19594
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20150304233739')
19595
+  (0.1ms) begin transaction
19596
+ SQL (0.5ms) INSERT INTO "clark_kent_reports" ("created_at", "resource_type", "updated_at") VALUES (?, ?, ?) [["created_at", "2015-04-29 18:14:45.711957"], ["resource_type", "Order"], ["updated_at", "2015-04-29 18:14:45.711957"]]
19597
+  (0.7ms) commit transaction
19598
+  (0.0ms) begin transaction
19599
+ 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]]
19600
+  (0.8ms) commit transaction
19601
+  (0.0ms) begin transaction
19602
+ 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]]
19603
+  (0.7ms) commit transaction
19604
+  (0.0ms) begin transaction
19605
+ 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]]
19606
+  (0.7ms) commit transaction
19607
+  (0.0ms) begin transaction
19608
+ 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]]
19609
+  (0.7ms) commit transaction
19610
+  (0.1ms) begin transaction
19611
+ SQL (0.3ms) INSERT INTO "departments" ("name") VALUES (?) [["name", "silly walks"]]
19612
+  (0.8ms) commit transaction
19613
+  (0.1ms) begin transaction
19614
+ SQL (0.3ms) INSERT INTO "users" ("department_id", "email", "name") VALUES (?, ?, ?) [["department_id", 1], ["email", "taproot@gmail.com"], ["name", "Michael Hedges"]]
19615
+  (0.8ms) commit transaction
19616
+  (0.0ms) begin transaction
19617
+ SQL (0.3ms) INSERT INTO "orders" ("amount", "created_at", "description", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["amount", 1], ["created_at", "2015-04-29 18:14:45.764371"], ["description", "Guitar strings"], ["updated_at", "2015-04-29 18:14:45.764371"], ["user_id", 1]]
19618
+  (0.7ms) commit transaction
19619
+ -------------------------
19620
+ ClarkKentTest: test_truth
19621
+ -------------------------
19622
+ ------------------------------------------------------------------------------------------------
19623
+ ClarkKent::ReportTest: test_can't_save_without_a_sharing_scope_id_if_the_sharing_scope_is_custom
19624
+ ------------------------------------------------------------------------------------------------
19625
+  (0.1ms) begin transaction
19626
+  (0.1ms) rollback transaction
19627
+ -----------------------------------------------------------
19628
+ ClarkKent::ReportsControllerTest: test_should_create_report
19629
+ -----------------------------------------------------------
19630
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
19631
+ User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
19632
+  (0.3ms) SELECT COUNT(*) FROM "clark_kent_reports"
19633
+ Processing by ClarkKent::ReportsController#create as HTML
19634
+ Parameters: {"report"=>{"name"=>"delete me", "resource_type"=>"Order", "sharing_scope_id"=>nil, "sharing_scope_type"=>nil}, "current_user_id"=>"1"}
19635
+  (0.1ms) begin transaction
19636
+ SQL (0.4ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-29 18:14:45.857419"], ["name", "delete me"], ["resource_type", "Order"], ["updated_at", "2015-04-29 18:14:45.857419"]]
19637
+  (0.7ms) commit transaction
19638
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (5.0ms)
19639
+ 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"]]
19640
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_index.html.erb (14.1ms)
19641
+ 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]]
19642
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_index.html.erb (3.2ms)
19643
+ 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]]
19644
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_index.html.erb (7.5ms)
19645
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/edit.html.erb within layouts/application (43.4ms)
19646
+ Completed 200 OK in 78ms (Views: 73.5ms | ActiveRecord: 2.2ms)
19647
+  (0.2ms) SELECT COUNT(*) FROM "clark_kent_reports"
19648
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."name" = 'delete me' LIMIT 1
19649
+  (0.0ms) begin transaction
19650
+ 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"]]
19651
+ 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]]
19652
+ 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]]
19653
+ SQL (0.3ms) DELETE FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? [["id", 2]]
19654
+  (0.9ms) commit transaction
19655
+ ------------------------------------------------------------
19656
+ ClarkKent::ReportsControllerTest: test_should_destroy_report
19657
+ ------------------------------------------------------------
19658
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
19659
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
19660
+  (0.0ms) begin transaction
19661
+ SQL (0.2ms) INSERT INTO "clark_kent_reports" ("created_at", "name", "resource_type", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-04-29 18:14:45.946648"], ["name", "delete me"], ["resource_type", "Order"], ["updated_at", "2015-04-29 18:14:45.946648"]]
19662
+  (0.8ms) commit transaction
19663
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
19664
+ Processing by ClarkKent::ReportsController#destroy as HTML
19665
+ Parameters: {"current_user_id"=>"1", "id"=>"3"}
19666
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 3]]
19667
+  (0.1ms) begin transaction
19668
+ 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"]]
19669
+ 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]]
19670
+ 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]]
19671
+ SQL (0.2ms) DELETE FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? [["id", 3]]
19672
+  (1.0ms) commit transaction
19673
+ Redirected to http://test.host/reports/reports
19674
+ Completed 302 Found in 6ms (ActiveRecord: 1.5ms)
19675
+  (0.2ms) SELECT COUNT(*) FROM "clark_kent_reports"
19676
+ ------------------------------------------------------
19677
+ ClarkKent::ReportsControllerTest: test_should_get_edit
19678
+ ------------------------------------------------------
19679
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
19680
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
19681
+ Processing by ClarkKent::ReportsController#edit as HTML
19682
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
19683
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
19684
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (0.9ms)
19685
+ 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"]]
19686
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_index.html.erb (1.3ms)
19687
+ 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]]
19688
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (1.4ms)
19689
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (3.5ms)
19690
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.4ms)
19691
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.5ms)
19692
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.4ms)
19693
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.5ms)
19694
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.3ms)
19695
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.5ms)
19696
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_index.html.erb (8.1ms)
19697
+ 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]]
19698
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_index.html.erb (1.1ms)
19699
+ Completed 200 OK in 15ms (Views: 14.0ms | ActiveRecord: 0.4ms)
19700
+ -------------------------------------------------------
19701
+ ClarkKent::ReportsControllerTest: test_should_get_index
19702
+ -------------------------------------------------------
19703
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
19704
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
19705
+ Processing by ClarkKent::ReportsController#index as HTML
19706
+ Parameters: {"current_user_id"=>"1"}
19707
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
19708
+ 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"]]
19709
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
19710
+ 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"]]
19711
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" IS NULL
19712
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" IS NULL
19713
+ Completed 200 OK in 23ms (Views: 22.3ms | ActiveRecord: 0.8ms)
19714
+ -----------------------------------------------------
19715
+ ClarkKent::ReportsControllerTest: test_should_get_new
19716
+ -----------------------------------------------------
19717
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
19718
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
19719
+ Processing by ClarkKent::ReportsController#new as HTML
19720
+ Parameters: {"current_user_id"=>"1"}
19721
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
19722
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
19723
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_edit.html.erb (63.0ms)
19724
+ Completed 200 OK in 68ms (Views: 67.7ms | ActiveRecord: 0.2ms)
19725
+ ---------------------------------------------------------
19726
+ ClarkKent::ReportsControllerTest: test_should_show_report
19727
+ ---------------------------------------------------------
19728
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
19729
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
19730
+ Processing by ClarkKent::ReportsController#show as HTML
19731
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
19732
+ 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
19733
+ 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
19734
+  (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"]]
19735
+  (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"]]
19736
+  (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"]]
19737
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.9ms)
19738
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
19739
+ User Load (0.1ms) SELECT "users".* FROM "users"
19740
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (1.8ms)
19741
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.5ms)
19742
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (0.6ms)
19743
+ Completed 200 OK in 23ms (Views: 16.1ms | ActiveRecord: 1.0ms)
19744
+ -----------------------------------------------------------------
19745
+ ClarkKent::ReportsControllerTest: test_should_show_report_results
19746
+ -----------------------------------------------------------------
19747
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
19748
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
19749
+ Processing by ClarkKent::ReportsController#show as HTML
19750
+ Parameters: {"current_user_id"=>"1", "run_report"=>true, "created_at_until"=>"2015-04-29", "created_at_from"=>"2015-04-28", "id"=>"1"}
19751
+ 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
19752
+ 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
19753
+ 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"]]
19754
+ 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]]
19755
+  (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"]]
19756
+  (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"]]
19757
+  (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"]]
19758
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.3ms)
19759
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
19760
+ User Load (0.1ms) SELECT "users".* FROM "users"
19761
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (1.3ms)
19762
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.1ms)
19763
+  (0.1ms) SELECT COUNT(*) FROM "orders"
19764
+  (0.2ms) SELECT COUNT(count_column) FROM (SELECT "orders"."id" AS count_column FROM "orders" LIMIT 10 OFFSET 0) subquery_for_count
19765
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (4.7ms)
19766
+ 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]]
19767
+ Order Load (0.1ms) SELECT DISTINCT orders.id, orders.user_id, orders.amount, orders.description, orders.created_at, orders.updated_at,
19768
+ (SELECT u.name
19769
+ FROM users u
19770
+ WHERE u.id = orders.user_id)
19771
+ as user_name, NULL FROM "orders" LIMIT 10 OFFSET 0
19772
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
19773
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
19774
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
19775
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
19776
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_download_link.html.erb (0.9ms)
19777
+ Completed 200 OK in 26ms (Views: 20.8ms | ActiveRecord: 1.7ms)
19778
+ --------------------------------------------------------------------
19779
+ ClarkKent::ReportsControllerTest: test_should_show_report_run_errors
19780
+ --------------------------------------------------------------------
19781
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
19782
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
19783
+ Processing by ClarkKent::ReportsController#show as HTML
19784
+ Parameters: {"current_user_id"=>"1", "run_report"=>true, "id"=>"1"}
19785
+ 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
19786
+ 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
19787
+ 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"]]
19788
+ 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]]
19789
+  (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"]]
19790
+  (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"]]
19791
+  (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"]]
19792
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.3ms)
19793
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
19794
+ User Load (0.1ms) SELECT "users".* FROM "users"
19795
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (1.0ms)
19796
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.1ms)
19797
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (0.0ms)
19798
+ Completed 200 OK in 39ms (Views: 34.3ms | ActiveRecord: 0.8ms)
19799
+ -----------------------------------------------------------
19800
+ ClarkKent::ReportsControllerTest: test_should_update_report
19801
+ -----------------------------------------------------------
19802
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
19803
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
19804
+ Processing by ClarkKent::ReportsController#update as HTML
19805
+ Parameters: {"report"=>{"name"=>nil, "resource_type"=>"Order", "sharing_scope_id"=>nil, "sharing_scope_type"=>nil}, "current_user_id"=>"1", "id"=>"1"}
19806
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
19807
+  (0.0ms) begin transaction
19808
+  (0.0ms) commit transaction
19809
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (0.9ms)
19810
+ Completed 200 OK in 3ms (Views: 1.2ms | ActiveRecord: 0.2ms)
19811
+ ---------------------------------------------------
19812
+ ClarkKent::ReportEmailTest: test_sends_report_to_s3
19813
+ ---------------------------------------------------
19814
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
19815
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
19816
+ SQL (1.3ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
19817
+  (0.1ms) begin transaction
19818
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
19819
+  (0.8ms) commit transaction
19820
+  (0.1ms) begin transaction
19821
+ 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-04-29 18:14:46.201456"], ["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-04-29 18:14:46.201456"]]
19822
+  (0.8ms) commit transaction
19823
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
19824
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
19825
+ 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"]]
19826
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
19827
+ 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]]
19828
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
19829
+ 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]]
19830
+ 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"]]
19831
+ 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"]]
19832
+ 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]]
19833
+ 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]]
19834
+ 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]]
19835
+ 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]]
19836
+  (0.2ms) SELECT COUNT(*) FROM "orders"
19837
+ -----------------------------------------------------------------------------------------
19838
+ ClarkKent::ReportEmailTest: test_throws_an_error_if_required_date_filters_are_not_present
19839
+ -----------------------------------------------------------------------------------------
19840
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'taproot@gmail.com' LIMIT 1
19841
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT 1
19842
+ SQL (1.0ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = 1
19843
+  (0.1ms) begin transaction
19844
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("name", "report_id") VALUES (?, ?) [["name", "test_emailer"], ["report_id", 1]]
19845
+  (0.7ms) commit transaction
19846
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
19847
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
19848
+ 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"]]
19849
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT 1 [["id", 1]]
19850
+ 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]]
19851
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT 1 [["id", 1]]
19852
+ 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]]
19853
+ 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"]]
19854
+ 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"]]
19855
+ 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]]
19856
+ 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]]