Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml Connecting to database specified by database.yml  (0.2ms) begin transaction CanvasOauth::Authorization Load (1.3ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Rendered text template (0.0ms) Completed 200 OK in 10ms (Views: 9.7ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"}  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 21ms (ActiveRecord: 0.1ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"invalid"} Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (3.5ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Wed, 12 Mar 2014 20:30:01 UTC +00:00], ["last_used_at", Wed, 12 Mar 2014 20:30:01 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Wed, 12 Mar 2014 20:30:01 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.2ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Wed, 12 Mar 2014 20:30:01 UTC +00:00], ["last_used_at", Wed, 12 Mar 2014 20:30:01 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Wed, 12 Mar 2014 20:30:01 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.2ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Wed, 12 Mar 2014 20:30:01 UTC +00:00], ["last_used_at", Wed, 12 Mar 2014 20:30:01 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Wed, 12 Mar 2014 20:30:01 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.2ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Wed, 12 Mar 2014 20:30:01 UTC +00:00], ["last_used_at", Wed, 12 Mar 2014 20:30:01 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Wed, 12 Mar 2014 20:30:01 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.2ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Wed, 12 Mar 2014 20:30:02 UTC +00:00], ["last_used_at", Wed, 12 Mar 2014 20:30:02 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Wed, 12 Mar 2014 20:30:02 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Wed, 12 Mar 2014 20:30:02 UTC +00:00], ["last_used_at", Wed, 12 Mar 2014 20:30:02 UTC +00:00], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Wed, 12 Mar 2014 20:30:02 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = '2014-03-12 20:30:02.005595', "updated_at" = '2014-03-12 20:30:02.005971' WHERE "canvas_oauth_authorizations"."id" = 2  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.3ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Wed, 12 Mar 2014 20:30:02 UTC +00:00], ["last_used_at", Wed, 12 Mar 2014 20:30:02 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", Wed, 12 Mar 2014 20:30:02 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.2ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml Connecting to database specified by database.yml  (0.3ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.1ms) begin transaction CanvasOauth::Authorization Load (1.4ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Rendered text template (0.0ms) Completed 200 OK in 20ms (Views: 19.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"}  (0.0ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 31ms (ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"invalid"} Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (31.0ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Wed, 30 Apr 2014 20:37:11 UTC +00:00], ["last_used_at", Wed, 30 Apr 2014 20:37:11 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Wed, 30 Apr 2014 20:37:11 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Wed, 30 Apr 2014 20:37:11 UTC +00:00], ["last_used_at", Wed, 30 Apr 2014 20:37:11 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Wed, 30 Apr 2014 20:37:11 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Wed, 30 Apr 2014 20:37:11 UTC +00:00], ["last_used_at", Wed, 30 Apr 2014 20:37:11 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Wed, 30 Apr 2014 20:37:11 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Wed, 30 Apr 2014 20:37:11 UTC +00:00], ["last_used_at", Wed, 30 Apr 2014 20:37:11 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Wed, 30 Apr 2014 20:37:11 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Wed, 30 Apr 2014 20:37:11 UTC +00:00], ["last_used_at", Wed, 30 Apr 2014 20:37:11 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", Wed, 30 Apr 2014 20:37:11 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Wed, 30 Apr 2014 20:37:11 UTC +00:00], ["last_used_at", Wed, 30 Apr 2014 20:37:11 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Wed, 30 Apr 2014 20:37:11 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Wed, 30 Apr 2014 20:37:11 UTC +00:00], ["last_used_at", Wed, 30 Apr 2014 20:37:11 UTC +00:00], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Wed, 30 Apr 2014 20:37:11 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = '2014-04-30 20:37:11.383205', "updated_at" = '2014-04-30 20:37:11.383685' WHERE "canvas_oauth_authorizations"."id" = 2  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml Connecting to database specified by database.yml  (0.3ms) begin transaction CanvasOauth::Authorization Load (1.6ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Rendered text template (0.0ms) Completed 200 OK in 31ms (Views: 30.6ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"}  (0.0ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 15ms (ActiveRecord: 0.1ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"invalid"} Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"mismatch"} Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"} Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (25.7ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 20:03:15 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 20:03:15 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 20:03:15 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.9ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 20:03:15 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 20:03:15 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 20:03:15 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 20:03:15 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 20:03:15 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 20:03:15 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 20:03:15 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 20:03:15 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 20:03:15 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 20:03:15 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 20:03:15 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 20:03:15 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 20:03:15 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 20:03:15 UTC +00:00], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 20:03:15 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = '2014-10-10 20:03:15.255668', "updated_at" = '2014-10-10 20:03:15.256128' WHERE "canvas_oauth_authorizations"."id" = 2  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 20:03:15 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 20:03:15 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", Fri, 10 Oct 2014 20:03:15 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) rollback transaction Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml  (0.2ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (3.8ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 20:27:41 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 20:27:41 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 20:27:41 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (1.2ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 20:27:41 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 20:27:41 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 20:27:41 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 20:27:41 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 20:27:41 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 20:27:41 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 20:27:41 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 20:27:41 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 20:27:41 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 20:27:41 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 20:27:41 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", Fri, 10 Oct 2014 20:27:41 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 20:27:41 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 20:27:41 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 20:27:41 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 20:27:41 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 20:27:41 UTC +00:00], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 20:27:41 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = ?, "updated_at" = ? WHERE "canvas_oauth_authorizations"."id" = 2 [["last_used_at", Fri, 10 Oct 2014 20:27:41 UTC +00:00], ["updated_at", Fri, 10 Oct 2014 20:27:41 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"} Rendered text template (0.0ms) Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"mismatch"} Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.1ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"invalid"} Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml Connecting to database specified by database.yml Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml Connecting to database specified by database.yml  (0.3ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/users/123/profile", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/api/v1/accounts/1/users", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/api/v1/accounts/1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/api/v1/courses/123/sections", {:query=>{:include=>["students", "avatar_url"], :per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/path", {:query=>"stuff", :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): post ["/api/v1/courses/123/assignments", {:body=>{:assignment=>{:name=>"Assignment"}}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/api/v1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/api/v1/courses/123/assignments", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/api/v1/courses/123/students", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/api/v1/courses/123", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): put ["/api/v1/courses/1/assignments/2/submissions/3", {:body=>{}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Rendered text template (0.0ms) Completed 200 OK in 33.3ms (Views: 32.9ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (1.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"}  (0.0ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 14.9ms (ActiveRecord: 0.1ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"mismatch"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0.3ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 1.3ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"invalid"} Completed 200 OK in 0.4ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (5.3ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:20:50 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:20:50 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:20:50 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.5ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:20:50 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:20:50 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:20:50 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.4ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:20:50 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:20:50 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:20:50 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.4ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:20:50 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:20:50 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:20:50 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:20:50 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:20:50 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", Fri, 10 Oct 2014 23:20:50 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:20:50 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:20:50 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:20:50 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (1.5ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:20:50 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:20:50 UTC +00:00], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:20:50 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = '2014-10-10 23:20:50.853501', "updated_at" = '2014-10-10 23:20:50.853890' WHERE "canvas_oauth_authorizations"."id" = 2  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.3ms) rollback transaction Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml Connecting to database specified by database.yml  (0.3ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (8.8ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:27:05 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:27:05 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:27:05 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:27:05 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:27:05 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:27:05 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:27:05 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:27:05 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:27:05 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:27:05 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:27:05 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:27:05 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:27:05 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:27:05 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", Fri, 10 Oct 2014 23:27:05 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:27:05 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:27:05 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:27:05 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:27:05 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:27:05 UTC +00:00], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:27:05 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = '2014-10-10 23:27:05.516333', "updated_at" = '2014-10-10 23:27:05.516892' WHERE "canvas_oauth_authorizations"."id" = 2  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/users", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/api/v1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:query=>"stuff", :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/api/v1/courses/123/students", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/api/v1/accounts/1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/api/v1/users/123/profile", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/sections", {:query=>{:include=>["students", "avatar_url"], :per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.04ms): post ["/api/v1/courses/123/assignments", {:body=>{:assignment=>{:name=>"Assignment"}}, :headers=>{}}]  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/assignments", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): put ["/api/v1/courses/1/assignments/2/submissions/3", {:body=>{}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"} Rendered text template (0.0ms) Completed 200 OK in 38.4ms (Views: 38.0ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3.6ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"mismatch"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0.3ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 1.2ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"invalid"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml Connecting to database specified by database.yml  (0.3ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (9.4ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:27:51 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:27:51 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:27:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:27:51 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:27:51 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:27:51 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:27:51 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:27:51 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:27:51 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:27:51 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:27:51 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:27:51 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:27:51 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:27:51 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", Fri, 10 Oct 2014 23:27:51 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:27:51 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:27:51 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:27:51 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:27:51 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:27:51 UTC +00:00], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:27:51 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = '2014-10-10 23:27:51.477255', "updated_at" = '2014-10-10 23:27:51.477588' WHERE "canvas_oauth_authorizations"."id" = 2  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/sections", {:query=>{:include=>["students", "avatar_url"], :per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/api/v1/courses/123", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:query=>"stuff", :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/assignments", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.05ms): get ["/api/v1/accounts/1/users", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/api/v1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/api/v1/courses/123/students", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/api/v1/accounts/1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/users/123/profile", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): post ["/api/v1/courses/123/assignments", {:body=>{:assignment=>{:name=>"Assignment"}}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): put ["/api/v1/courses/1/assignments/2/submissions/3", {:body=>{}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.1ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"} Rendered text template (0.0ms) Completed 200 OK in 33.6ms (Views: 33.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0.2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3.6ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"mismatch"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0.3ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 1.2ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"invalid"} Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml Connecting to database specified by database.yml  (0.2ms) begin transaction CanvasOauth::Authorization Load (1.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Rendered text template (0.0ms) Completed 200 OK in 7.6ms (Views: 7.3ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 9.7ms (ActiveRecord: 0.1ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"invalid"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 1.3ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"mismatch"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"} Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/users/123/profile", {:headers=>{}}]  (0.0ms) rollback transaction  (0.1ms) begin transaction API call (0.02ms): get ["/api/v1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/api/v1/accounts/1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): put ["/api/v1/courses/1/assignments/2/submissions/3", {:body=>{}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/students", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.04ms): get ["/api/v1/courses/123/sections", {:query=>{:include=>["students", "avatar_url"], :per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/api/v1/accounts/1/users", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): post ["/api/v1/courses/123/assignments", {:body=>{:assignment=>{:name=>"Assignment"}}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.04ms): get ["/path", {:query=>"stuff", :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/assignments", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (3.1ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:28:49 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:28:49 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:28:49 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (1.0ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:28:49 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:28:49 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:28:49 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:28:49 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:28:49 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:28:49 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:28:49 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:28:49 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:28:49 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:28:49 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:28:49 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:28:49 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:28:49 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:28:49 UTC +00:00], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:28:49 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = '2014-10-10 23:28:49.625276', "updated_at" = '2014-10-10 23:28:49.625608' WHERE "canvas_oauth_authorizations"."id" = 2  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:28:49 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:28:49 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", Fri, 10 Oct 2014 23:28:49 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.3ms) rollback transaction Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml Connecting to database specified by database.yml  (0.3ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (6.8ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:29:07 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:29:07 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:29:07 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:29:07 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:29:07 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:29:07 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:29:07 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:29:07 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:29:07 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:29:07 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:29:07 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:29:07 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:29:07 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:29:07 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", Fri, 10 Oct 2014 23:29:07 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:29:07 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:29:07 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:29:07 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:29:07 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:29:07 UTC +00:00], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:29:07 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = '2014-10-10 23:29:07.750026', "updated_at" = '2014-10-10 23:29:07.750412' WHERE "canvas_oauth_authorizations"."id" = 2  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/assignments", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/api/v1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/api/v1/users/123/profile", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): put ["/api/v1/courses/1/assignments/2/submissions/3", {:body=>{}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:query=>"stuff", :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/api/v1/courses/123/students", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): post ["/api/v1/courses/123/assignments", {:body=>{:assignment=>{:name=>"Assignment"}}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/api/v1/courses/123/sections", {:query=>{:include=>["students", "avatar_url"], :per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/users", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/api/v1/courses/123", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/api/v1/accounts/1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Rendered text template (0.0ms) Completed 200 OK in 32.3ms (Views: 32.0ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4.5ms (ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"mismatch"} Completed 200 OK in 0.4ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0.4ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 1.4ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"invalid"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml Connecting to database specified by database.yml Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml Connecting to database specified by database.yml  (0.2ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/sections", {:query=>{:include=>["students", "avatar_url"], :per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:query=>"stuff", :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): post ["/api/v1/courses/123/assignments", {:body=>{:assignment=>{:name=>"Assignment"}}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): put ["/api/v1/courses/1/assignments/2/submissions/3", {:body=>{}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/users/123/profile", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/students", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/users", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/assignments", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.4ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 13.8ms (ActiveRecord: 0.1ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"mismatch"} Completed 200 OK in 11.8ms (Views: 11.7ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0.3ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 1.4ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"invalid"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (4.4ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:30:11 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:30:11 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:30:11 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (1.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:30:11 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:30:11 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:30:11 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (2.2ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:30:11 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:30:11 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:30:11 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (2.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:30:11 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:30:11 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:30:11 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (1.2ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:30:11 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:30:11 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", Fri, 10 Oct 2014 23:30:11 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (1.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:30:11 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:30:11 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:30:11 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:30:11 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:30:11 UTC +00:00], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:30:11 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = '2014-10-10 23:30:11.702770', "updated_at" = '2014-10-10 23:30:11.703137' WHERE "canvas_oauth_authorizations"."id" = 2  (0.0ms) RELEASE SAVEPOINT active_record_1  (2.3ms) rollback transaction Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml Connecting to database specified by database.yml  (0.2ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (2.8ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:30:29 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:30:29 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", Fri, 10 Oct 2014 23:30:29 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (1.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:30:29 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:30:29 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:30:29 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:30:29 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:30:29 UTC +00:00], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:30:29 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = '2014-10-10 23:30:29.486849', "updated_at" = '2014-10-10 23:30:29.487345' WHERE "canvas_oauth_authorizations"."id" = 2  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.3ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:30:29 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:30:29 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:30:29 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:30:29 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:30:29 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:30:29 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:30:29 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:30:29 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:30:29 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:30:29 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:30:29 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:30:29 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.1ms) begin transaction  (0.2ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/students", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/assignments", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/sections", {:query=>{:include=>["students", "avatar_url"], :per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:query=>"stuff", :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): put ["/api/v1/courses/1/assignments/2/submissions/3", {:body=>{}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/users/123/profile", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): post ["/api/v1/courses/123/assignments", {:body=>{:assignment=>{:name=>"Assignment"}}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/users", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Rendered text template (0.0ms) Completed 200 OK in 8.6ms (Views: 8.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"mismatch"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3.4ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"invalid"} Completed 200 OK in 0.4ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 1.7ms (ActiveRecord: 0.1ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0.4ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml Connecting to database specified by database.yml  (0.3ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Rendered text template (0.0ms) Completed 200 OK in 24.6ms (Views: 24.3ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 9.5ms (ActiveRecord: 0.1ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"invalid"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"} Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 1.3ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"mismatch"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Completed 200 OK in 0.3ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (2.9ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:32:25 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:32:25 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:32:25 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:32:25 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:32:25 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:32:25 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:32:25 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:32:25 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:32:25 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:32:25 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:32:25 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:32:25 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:32:25 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:32:25 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:32:25 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:32:25 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:32:25 UTC +00:00], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:32:25 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = '2014-10-10 23:32:25.538869', "updated_at" = '2014-10-10 23:32:25.539266' WHERE "canvas_oauth_authorizations"."id" = 2  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:32:25 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:32:25 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", Fri, 10 Oct 2014 23:32:25 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.05ms): get ["/api/v1/users/123/profile", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/users", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/sections", {:query=>{:include=>["students", "avatar_url"], :per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/students", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): put ["/api/v1/courses/1/assignments/2/submissions/3", {:body=>{}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/assignments", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:query=>"stuff", :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): post ["/api/v1/courses/123/assignments", {:body=>{:assignment=>{:name=>"Assignment"}}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml Connecting to database specified by database.yml  (0.3ms) begin transaction CanvasOauth::Authorization Load (0.4ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Rendered text template (0.0ms) Completed 200 OK in 31.6ms (Views: 31.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"}  (0.0ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 12.4ms (ActiveRecord: 0.1ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"invalid"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 1.2ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"mismatch"} Completed 200 OK in 0.2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"} Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.09ms): get ["/api/v1/users/123/profile", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.06ms): get ["/api/v1/accounts/1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/assignments", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/sections", {:query=>{:include=>["students", "avatar_url"], :per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/users", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:query=>"stuff", :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.04ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.05ms): put ["/api/v1/courses/1/assignments/2/submissions/3", {:body=>{}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/students", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): post ["/api/v1/courses/123/assignments", {:body=>{:assignment=>{:name=>"Assignment"}}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (6.4ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:34:09 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:34:09 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:34:09 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:34:09 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:34:09 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:34:09 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.2ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:34:09 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:34:09 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:34:09 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:34:09 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:34:09 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:34:09 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:34:09 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:34:09 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:34:09 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:34:09 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:34:09 UTC +00:00], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:34:09 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = '2014-10-10 23:34:09.035190', "updated_at" = '2014-10-10 23:34:09.035525' WHERE "canvas_oauth_authorizations"."id" = 2  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.3ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:34:09 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:34:09 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", Fri, 10 Oct 2014 23:34:09 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml Connecting to database specified by database.yml  (0.2ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (4.9ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:36:57 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:36:57 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:36:57 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:36:57 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:36:57 UTC +00:00], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:36:57 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = '2014-10-10 23:36:57.334891', "updated_at" = '2014-10-10 23:36:57.335521' WHERE "canvas_oauth_authorizations"."id" = 2  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:36:57 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:36:57 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", Fri, 10 Oct 2014 23:36:57 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:36:57 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:36:57 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:36:57 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:36:57 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:36:57 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:36:57 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:36:57 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:36:57 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:36:57 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:36:57 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:36:57 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:36:57 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/users/123/profile", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): put ["/api/v1/courses/1/assignments/2/submissions/3", {:body=>{}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/sections", {:query=>{:include=>["students", "avatar_url"], :per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): post ["/api/v1/courses/123/assignments", {:body=>{:assignment=>{:name=>"Assignment"}}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/assignments", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:query=>"stuff", :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.1ms) begin transaction API call (0.04ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/users", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/students", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Rendered text template (0.0ms) Completed 200 OK in 12.6ms (Views: 12.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"} Completed 200 OK in 0.4ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"mismatch"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3.9ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"invalid"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2.2ms (ActiveRecord: 0.1ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0.4ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml Connecting to database specified by database.yml  (0.2ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Rendered text template (0.0ms) Completed 200 OK in 26.1ms (Views: 25.8ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"invalid"} Completed 200 OK in 0.4ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 10.7ms (ActiveRecord: 0.1ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0.4ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"mismatch"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 1.3ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.06ms): get ["/api/v1/courses/123/students", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.05ms): get ["/api/v1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): put ["/api/v1/courses/1/assignments/2/submissions/3", {:body=>{}, :headers=>{}}]  (0.0ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/sections", {:query=>{:include=>["students", "avatar_url"], :per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/users", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:query=>"stuff", :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/assignments", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): post ["/api/v1/courses/123/assignments", {:body=>{:assignment=>{:name=>"Assignment"}}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/users/123/profile", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (3.4ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:37:52 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:37:52 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", Fri, 10 Oct 2014 23:37:52 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:37:52 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:37:52 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:37:52 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:37:52 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:37:52 UTC +00:00], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:37:52 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = '2014-10-10 23:37:52.147804', "updated_at" = '2014-10-10 23:37:52.148306' WHERE "canvas_oauth_authorizations"."id" = 2  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.3ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:37:52 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:37:52 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:37:52 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:37:52 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:37:52 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:37:52 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:37:52 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:37:52 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:37:52 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Fri, 10 Oct 2014 23:37:52 UTC +00:00], ["last_used_at", Fri, 10 Oct 2014 23:37:52 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Fri, 10 Oct 2014 23:37:52 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml Connecting to database specified by database.yml  (0.3ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/users/123/profile", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/users", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): put ["/api/v1/courses/1/assignments/2/submissions/3", {:body=>{}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/students", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.07ms): get ["/path", {:headers=>{}}]  (0.1ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:query=>"stuff", :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/sections", {:query=>{:include=>["students", "avatar_url"], :per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/assignments", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): post ["/api/v1/courses/123/assignments", {:body=>{:assignment=>{:name=>"Assignment"}}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.4ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 38.1ms (ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"mismatch"} Completed 200 OK in 13.3ms (Views: 13.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0.4ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 1.4ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"invalid"} Completed 200 OK in 0.3ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"} Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (5.4ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:04:47 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:04:47 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:04:47 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.6ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:04:47 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:04:47 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:04:47 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:04:47 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:04:47 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:04:47 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:04:47 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:04:47 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:04:47 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:04:47 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:04:47 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:04:47 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:04:47 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:04:47 UTC +00:00], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:04:47 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = '2014-10-11 01:04:47.160198', "updated_at" = '2014-10-11 01:04:47.160529' WHERE "canvas_oauth_authorizations"."id" = 2  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:04:47 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:04:47 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", Sat, 11 Oct 2014 01:04:47 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml Connecting to database specified by database.yml  (0.2ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): put ["/api/v1/courses/1/assignments/2/submissions/3", {:body=>{}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/users/123/profile", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): post ["/api/v1/courses/123/assignments", {:body=>{:assignment=>{:name=>"Assignment"}}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/assignments", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/users", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/students", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:query=>"stuff", :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/sections", {:query=>{:include=>["students", "avatar_url"], :per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 28.6ms (ActiveRecord: 0.1ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"mismatch"} Completed 200 OK in 7.2ms (Views: 7.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 1.3ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"invalid"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"} Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (2.9ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:05:21 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:05:21 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:05:21 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (1.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:05:21 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:05:21 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:05:21 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.5ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:05:21 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:05:21 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:05:21 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:05:21 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:05:21 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:05:21 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:05:21 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:05:21 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:05:21 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:05:21 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:05:21 UTC +00:00], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:05:21 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = '2014-10-11 01:05:21.062261', "updated_at" = '2014-10-11 01:05:21.062612' WHERE "canvas_oauth_authorizations"."id" = 2  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:05:21 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:05:21 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", Sat, 11 Oct 2014 01:05:21 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.3ms) rollback transaction Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml Connecting to database specified by database.yml  (0.3ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/students", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/sections", {:query=>{:include=>["students", "avatar_url"], :per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): post ["/api/v1/courses/123/assignments", {:body=>{:assignment=>{:name=>"Assignment"}}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.04ms): get ["/api/v1/users/123/profile", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.1ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/assignments", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:query=>"stuff", :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): put ["/api/v1/courses/1/assignments/2/submissions/3", {:body=>{}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/users", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (3.9ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:06:22 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:06:22 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", Sat, 11 Oct 2014 01:06:22 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:06:22 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:06:22 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:06:22 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:06:22 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:06:22 UTC +00:00], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:06:22 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = '2014-10-11 01:06:22.943841', "updated_at" = '2014-10-11 01:06:22.944400' WHERE "canvas_oauth_authorizations"."id" = 2  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:06:22 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:06:22 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:06:22 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:06:22 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:06:22 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:06:22 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:06:22 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:06:22 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:06:22 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:06:22 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:06:22 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:06:22 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Rendered text template (0.0ms) Completed 200 OK in 11.1ms (Views: 10.8ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"mismatch"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.3ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3.8ms (ActiveRecord: 0.1ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"} Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"invalid"} Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 1.1ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0.4ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml Connecting to database specified by database.yml  (0.2ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Rendered text template (0.0ms) Completed 200 OK in 26.1ms (Views: 25.9ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"invalid"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"}  (0.1ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 10.7ms (ActiveRecord: 0.1ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"mismatch"} Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 1.3ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0.2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"} Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): post ["/api/v1/courses/123/assignments", {:body=>{:assignment=>{:name=>"Assignment"}}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/students", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/users/123/profile", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/assignments", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/users", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:query=>"stuff", :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/sections", {:query=>{:include=>["students", "avatar_url"], :per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): put ["/api/v1/courses/1/assignments/2/submissions/3", {:body=>{}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (2.9ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:09:41 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:09:41 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", Sat, 11 Oct 2014 01:09:41 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (1.0ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:09:41 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:09:41 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:09:41 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:09:41 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:09:41 UTC +00:00], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:09:41 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = '2014-10-11 01:09:41.737516', "updated_at" = '2014-10-11 01:09:41.738033' WHERE "canvas_oauth_authorizations"."id" = 2  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:09:41 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:09:41 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:09:41 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:09:41 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:09:41 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:09:41 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:09:41 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:09:41 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:09:41 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:09:41 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:09:41 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:09:41 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml Connecting to database specified by database.yml  (0.2ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/users/123/profile", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:query=>"stuff", :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/students", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/assignments", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): post ["/api/v1/courses/123/assignments", {:body=>{:assignment=>{:name=>"Assignment"}}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/sections", {:query=>{:include=>["students", "avatar_url"], :per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/users", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): put ["/api/v1/courses/1/assignments/2/submissions/3", {:body=>{}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (2.8ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:10:00 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:10:00 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:10:00 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.9ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:10:00 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:10:00 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:10:00 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:10:00 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:10:00 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:10:00 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:10:00 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:10:00 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:10:00 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:10:00 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:10:00 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:10:00 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:10:00 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:10:00 UTC +00:00], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:10:00 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = '2014-10-11 01:10:00.655065', "updated_at" = '2014-10-11 01:10:00.655422' WHERE "canvas_oauth_authorizations"."id" = 2  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:10:00 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:10:00 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", Sat, 11 Oct 2014 01:10:00 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2.9ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"mismatch"} Completed 200 OK in 9.8ms (Views: 9.7ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0.5ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 1.6ms (ActiveRecord: 0.1ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"invalid"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml Connecting to database specified by database.yml  (0.2ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/users/123/profile", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): post ["/api/v1/courses/123/assignments", {:body=>{:assignment=>{:name=>"Assignment"}}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/students", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): put ["/api/v1/courses/1/assignments/2/submissions/3", {:body=>{}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/assignments", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/sections", {:query=>{:include=>["students", "avatar_url"], :per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/users", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.07ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:query=>"stuff", :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (4.0ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:10:56 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:10:56 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:10:56 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.5ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:10:56 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:10:56 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:10:56 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:10:56 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:10:56 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:10:56 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.2ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:10:56 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:10:56 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:10:56 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:10:56 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:10:56 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", Sat, 11 Oct 2014 01:10:56 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:10:56 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:10:56 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:10:56 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:10:56 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:10:56 UTC +00:00], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:10:56 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = '2014-10-11 01:10:56.315268', "updated_at" = '2014-10-11 01:10:56.315712' WHERE "canvas_oauth_authorizations"."id" = 2  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3.7ms (ActiveRecord: 0.1ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"mismatch"} Completed 200 OK in 10.1ms (Views: 10.0ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"} Completed 200 OK in 0.5ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0.4ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 1.4ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"invalid"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml Connecting to database specified by database.yml  (0.2ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Rendered text template (0.0ms) Completed 200 OK in 8.0ms (Views: 7.7ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"invalid"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 10.4ms (ActiveRecord: 0.1ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"} Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"mismatch"} Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 1.3ms (ActiveRecord: 0.1ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (27.7ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:12:05 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:12:05 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", Sat, 11 Oct 2014 01:12:05 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (1.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:12:05 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:12:05 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:12:05 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:12:05 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:12:05 UTC +00:00], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:12:05 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = '2014-10-11 01:12:05.112637', "updated_at" = '2014-10-11 01:12:05.113416' WHERE "canvas_oauth_authorizations"."id" = 2  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:12:05 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:12:05 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:12:05 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:12:05 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:12:05 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:12:05 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:12:05 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:12:05 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:12:05 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:12:05 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:12:05 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:12:05 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.06ms): get ["/api/v1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:query=>"stuff", :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/assignments", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/students", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/users", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): post ["/api/v1/courses/123/assignments", {:body=>{:assignment=>{:name=>"Assignment"}}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): put ["/api/v1/courses/1/assignments/2/submissions/3", {:body=>{}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/sections", {:query=>{:include=>["students", "avatar_url"], :per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/users/123/profile", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml Connecting to database specified by database.yml  (0.2ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Rendered text template (0.0ms) Completed 200 OK in 7.6ms (Views: 7.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 9.8ms (ActiveRecord: 0.1ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"invalid"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 1.2ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"mismatch"} Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"} Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.05ms): post ["/api/v1/courses/123/assignments", {:body=>{:assignment=>{:name=>"Assignment"}}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/users", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): put ["/api/v1/courses/1/assignments/2/submissions/3", {:body=>{}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/assignments", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/users/123/profile", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:query=>"stuff", :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/sections", {:query=>{:include=>["students", "avatar_url"], :per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/students", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (3.1ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:13:04 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:13:04 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:13:04 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.8ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:13:04 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:13:04 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:13:04 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:13:04 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:13:04 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:13:04 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:13:04 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:13:04 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:13:04 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:13:04 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:13:04 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:13:04 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:13:04 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:13:04 UTC +00:00], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:13:04 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = '2014-10-11 01:13:04.478141', "updated_at" = '2014-10-11 01:13:04.478447' WHERE "canvas_oauth_authorizations"."id" = 2  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:13:04 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:13:04 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", Sat, 11 Oct 2014 01:13:04 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.3ms) rollback transaction Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml Connecting to database specified by database.yml  (0.2ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/sections", {:query=>{:include=>["students", "avatar_url"], :per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): post ["/api/v1/courses/123/assignments", {:body=>{:assignment=>{:name=>"Assignment"}}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/assignments", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:query=>"stuff", :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): put ["/api/v1/courses/1/assignments/2/submissions/3", {:body=>{}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/users", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/users/123/profile", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/students", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (2.7ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:13:13 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:13:13 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:13:13 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (1.2ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:13:13 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:13:13 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:13:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.5ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:13:13 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:13:13 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:13:13 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:13:13 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:13:13 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:13:13 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:13:13 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:13:13 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", Sat, 11 Oct 2014 01:13:13 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:13:13 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:13:13 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:13:13 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:13:13 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:13:13 UTC +00:00], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:13:13 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = '2014-10-11 01:13:13.374155', "updated_at" = '2014-10-11 01:13:13.374476' WHERE "canvas_oauth_authorizations"."id" = 2  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3.5ms (ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"mismatch"} Completed 200 OK in 28.7ms (Views: 28.6ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"} Completed 200 OK in 0.4ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0.4ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 1.5ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"invalid"} Completed 200 OK in 0.4ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml Connecting to database specified by database.yml  (0.2ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (2.8ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:15:34 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:15:34 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:15:34 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:15:34 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:15:34 UTC +00:00], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:15:34 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = '2014-10-11 01:15:34.171075', "updated_at" = '2014-10-11 01:15:34.171535' WHERE "canvas_oauth_authorizations"."id" = 2  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:15:34 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:15:34 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", Sat, 11 Oct 2014 01:15:34 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:15:34 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:15:34 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:15:34 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:15:34 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:15:34 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:15:34 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:15:34 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:15:34 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:15:34 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:15:34 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:15:34 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:15:34 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Rendered text template (0.0ms) Completed 200 OK in 7.5ms (Views: 7.3ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"} Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"invalid"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 23.0ms (ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0.5ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"mismatch"} Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 1.2ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/users", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/assignments", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): put ["/api/v1/courses/1/assignments/2/submissions/3", {:body=>{}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/students", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/users/123/profile", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): post ["/api/v1/courses/123/assignments", {:body=>{:assignment=>{:name=>"Assignment"}}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/sections", {:query=>{:include=>["students", "avatar_url"], :per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:query=>"stuff", :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml Connecting to database specified by database.yml  (0.2ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Rendered text template (0.0ms) Completed 200 OK in 7.4ms (Views: 7.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 9.5ms (ActiveRecord: 0.1ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"invalid"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"} Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 1.2ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"mismatch"} Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (2.9ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:15:59 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:15:59 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:15:59 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (1.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:15:59 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:15:59 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:15:59 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:15:59 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:15:59 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:15:59 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:15:59 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:15:59 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:15:59 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:15:59 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:15:59 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:15:59 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:15:59 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:15:59 UTC +00:00], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:15:59 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = '2014-10-11 01:15:59.652439', "updated_at" = '2014-10-11 01:15:59.652805' WHERE "canvas_oauth_authorizations"."id" = 2  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:15:59 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:15:59 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", Sat, 11 Oct 2014 01:15:59 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.5ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:query=>"stuff", :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/users/123/profile", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/assignments", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/sections", {:query=>{:include=>["students", "avatar_url"], :per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/users", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/students", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): put ["/api/v1/courses/1/assignments/2/submissions/3", {:body=>{}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): post ["/api/v1/courses/123/assignments", {:body=>{:assignment=>{:name=>"Assignment"}}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml Connecting to database specified by database.yml Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml Connecting to database specified by database.yml  (0.2ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (2.8ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:21:28 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:21:28 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", Sat, 11 Oct 2014 01:21:28 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (1.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:21:28 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:21:28 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:21:28 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:21:28 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:21:28 UTC +00:00], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:21:28 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = '2014-10-11 01:21:28.087603', "updated_at" = '2014-10-11 01:21:28.088246' WHERE "canvas_oauth_authorizations"."id" = 2  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:21:28 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:21:28 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:21:28 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:21:28 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:21:28 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:21:28 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:21:28 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:21:28 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:21:28 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:21:28 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:21:28 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:21:28 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/students", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/assignments", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): post ["/api/v1/courses/123/assignments", {:body=>{:assignment=>{:name=>"Assignment"}}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:query=>"stuff", :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/users", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/users/123/profile", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): put ["/api/v1/courses/1/assignments/2/submissions/3", {:body=>{}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/sections", {:query=>{:include=>["students", "avatar_url"], :per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Rendered text template (0.0ms) Completed 200 OK in 27.2ms (Views: 27.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"mismatch"} Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3.3ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"invalid"} Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 1.2ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0.3ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml Connecting to database specified by database.yml  (0.2ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (2.6ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:23:17 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:23:17 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", Sat, 11 Oct 2014 01:23:17 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (1.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:23:17 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:23:17 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:23:17 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:23:17 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:23:17 UTC +00:00], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:23:17 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = '2014-10-11 01:23:17.417734', "updated_at" = '2014-10-11 01:23:17.418213' WHERE "canvas_oauth_authorizations"."id" = 2  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:23:17 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:23:17 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:23:17 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:23:17 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:23:17 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:23:17 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:23:17 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:23:17 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:23:17 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:23:17 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:23:17 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:23:17 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction API call (0.05ms): get ["/api/v1/users/123/profile", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): post ["/api/v1/courses/123/assignments", {:body=>{:assignment=>{:name=>"Assignment"}}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/sections", {:query=>{:include=>["students", "avatar_url"], :per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/assignments", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): put ["/api/v1/courses/1/assignments/2/submissions/3", {:body=>{}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/students", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:query=>"stuff", :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/users", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Rendered text template (0.0ms) Completed 200 OK in 26.6ms (Views: 26.5ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"mismatch"} Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2.9ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"invalid"} Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 1.2ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0.3ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml Connecting to database specified by database.yml  (0.2ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (2.7ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:23:47 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:23:47 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", Sat, 11 Oct 2014 01:23:47 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (1.1ms) rollback transaction  (0.1ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:23:47 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:23:47 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:23:47 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:23:47 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:23:47 UTC +00:00], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:23:47 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = '2014-10-11 01:23:47.240847', "updated_at" = '2014-10-11 01:23:47.241594' WHERE "canvas_oauth_authorizations"."id" = 2  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:23:47 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:23:47 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:23:47 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:23:47 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:23:47 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:23:47 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:23:47 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:23:47 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:23:47 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:23:47 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:23:47 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:23:47 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/assignments", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/users/123/profile", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): put ["/api/v1/courses/1/assignments/2/submissions/3", {:body=>{}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/users", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): post ["/api/v1/courses/123/assignments", {:body=>{:assignment=>{:name=>"Assignment"}}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:query=>"stuff", :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/students", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.1ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/sections", {:query=>{:include=>["students", "avatar_url"], :per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Rendered text template (0.0ms) Completed 200 OK in 26.3ms (Views: 26.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"mismatch"} Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3.0ms (ActiveRecord: 0.1ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"invalid"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 1.2ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0.3ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml Connecting to database specified by database.yml  (0.2ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (2.8ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:25:23 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:25:23 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", Sat, 11 Oct 2014 01:25:23 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (1.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:25:23 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:25:23 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:25:23 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:25:23 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:25:23 UTC +00:00], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:25:23 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = '2014-10-11 01:25:23.462465', "updated_at" = '2014-10-11 01:25:23.463046' WHERE "canvas_oauth_authorizations"."id" = 2  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:25:23 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:25:23 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:25:23 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:25:23 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:25:23 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:25:23 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.5ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:25:23 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:25:23 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:25:23 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.6ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:25:23 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:25:23 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:25:23 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Rendered text template (0.0ms) Completed 200 OK in 7.8ms (Views: 7.7ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"} Completed 200 OK in 0.5ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"invalid"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 27.0ms (ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0.5ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"mismatch"} Completed 200 OK in 0.4ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 1.3ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/assignments", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/users/123/profile", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/users", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): put ["/api/v1/courses/1/assignments/2/submissions/3", {:body=>{}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/students", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): post ["/api/v1/courses/123/assignments", {:body=>{:assignment=>{:name=>"Assignment"}}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/sections", {:query=>{:include=>["students", "avatar_url"], :per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:query=>"stuff", :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml  (0.3ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): put ["/api/v1/courses/1/assignments/2/submissions/3", {:body=>{}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/students", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.09ms): get ["/path", {:headers=>{}}]  (0.1ms) rollback transaction  (0.0ms) begin transaction API call (0.04ms): get ["/path", {:query=>"stuff", :headers=>{}}]  (0.1ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.1ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/sections", {:query=>{:include=>["students", "avatar_url"], :per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/users", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): post ["/api/v1/courses/123/assignments", {:body=>{:assignment=>{:name=>"Assignment"}}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/users/123/profile", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/assignments", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (3.3ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:31:14 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:31:14 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:31:14 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:31:14 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:31:14 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:31:14 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:31:14 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:31:14 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:31:14 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:31:14 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:31:14 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:31:14 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:31:14 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:31:14 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:31:14 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:31:14 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:31:14 UTC +00:00], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:31:14 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = ?, "updated_at" = ? WHERE "canvas_oauth_authorizations"."id" = 2 [["last_used_at", Sat, 11 Oct 2014 01:31:14 UTC +00:00], ["updated_at", Sat, 11 Oct 2014 01:31:14 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:31:14 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:31:14 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", Sat, 11 Oct 2014 01:31:14 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.3ms) rollback transaction  (0.1ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"}  (0.1ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"mismatch"} Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"} Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.1ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"invalid"} Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml  (0.3ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction API call (0.06ms): get ["/api/v1/accounts/1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): put ["/api/v1/courses/1/assignments/2/submissions/3", {:body=>{}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): post ["/api/v1/courses/123/assignments", {:body=>{:assignment=>{:name=>"Assignment"}}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/users/123/profile", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/assignments", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/users", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.1ms) begin transaction API call (0.18ms): get ["/path", {:headers=>{}}]  (0.2ms) rollback transaction  (0.1ms) begin transaction API call (0.05ms): get ["/path", {:query=>"stuff", :headers=>{}}]  (0.1ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/students", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/sections", {:query=>{:include=>["students", "avatar_url"], :per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (5.7ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:33:57 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:33:57 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:33:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:33:57 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:33:57 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:33:57 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:33:57 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:33:57 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:33:57 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:33:57 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:33:57 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:33:57 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (1.1ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:33:57 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:33:57 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", Sat, 11 Oct 2014 01:33:57 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:33:57 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:33:57 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:33:57 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:33:57 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:33:57 UTC +00:00], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:33:57 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = ?, "updated_at" = ? WHERE "canvas_oauth_authorizations"."id" = 2 [["last_used_at", Sat, 11 Oct 2014 01:33:57 UTC +00:00], ["updated_at", Sat, 11 Oct 2014 01:33:57 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.3ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.1ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"mismatch"} Completed 200 OK in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"} Completed 200 OK in 26ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.1ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"invalid"} Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml  (0.2ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (3.5ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:34:54 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:34:53 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", Sat, 11 Oct 2014 01:34:54 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.8ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:34:54 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:34:54 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:34:54 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:34:54 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:34:54 UTC +00:00], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:34:54 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = ?, "updated_at" = ? WHERE "canvas_oauth_authorizations"."id" = 2 [["last_used_at", Sat, 11 Oct 2014 01:34:54 UTC +00:00], ["updated_at", Sat, 11 Oct 2014 01:34:54 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:34:54 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:34:54 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:34:54 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:34:54 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:34:54 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:34:54 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:34:54 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:34:54 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:34:54 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.4ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.6ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:34:54 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:34:54 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:34:54 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): put ["/api/v1/courses/1/assignments/2/submissions/3", {:body=>{}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/students", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/users/123/profile", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/users", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/assignments", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:query=>"stuff", :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): post ["/api/v1/courses/123/assignments", {:body=>{:assignment=>{:name=>"Assignment"}}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/sections", {:query=>{:include=>["students", "avatar_url"], :per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Rendered text template (0.0ms) Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"} Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"mismatch"} Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 28ms (ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"invalid"} Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.1ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml  (0.3ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): post ["/api/v1/courses/123/assignments", {:body=>{:assignment=>{:name=>"Assignment"}}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/sections", {:query=>{:include=>["students", "avatar_url"], :per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/assignments", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/users/123/profile", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:query=>"stuff", :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): put ["/api/v1/courses/1/assignments/2/submissions/3", {:body=>{}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/users", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/students", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (2.7ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:35:47 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:35:47 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", Sat, 11 Oct 2014 01:35:47 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (1.0ms) rollback transaction  (0.1ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:35:47 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:35:47 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:35:47 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:35:47 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:35:47 UTC +00:00], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:35:47 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = ?, "updated_at" = ? WHERE "canvas_oauth_authorizations"."id" = 2 [["last_used_at", Sat, 11 Oct 2014 01:35:47 UTC +00:00], ["updated_at", Sat, 11 Oct 2014 01:35:47 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:35:47 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:35:47 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:35:47 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:35:47 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:35:47 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:35:47 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.5ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:35:47 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:35:47 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:35:47 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:35:47 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:35:47 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:35:47 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Rendered text template (0.0ms) Completed 200 OK in 8ms (Views: 7.6ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"mismatch"} Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"} Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"invalid"} Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.1ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml  (0.3ms) begin transaction CanvasOauth::Authorization Load (19.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Rendered text template (0.0ms) Completed 200 OK in 7ms (Views: 6.9ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"}  (0.0ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 31ms (ActiveRecord: 0.3ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"invalid"} Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"} Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.1ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"mismatch"} Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (2.9ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:36:26 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:36:26 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:36:26 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (1.1ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:36:26 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:36:26 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:36:26 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:36:26 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:36:26 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:36:26 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.5ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:36:26 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:36:26 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:36:26 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.3ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:36:26 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:36:26 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:36:26 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:36:26 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:36:26 UTC +00:00], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:36:26 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = ?, "updated_at" = ? WHERE "canvas_oauth_authorizations"."id" = 2 [["last_used_at", Sat, 11 Oct 2014 01:36:26 UTC +00:00], ["updated_at", Sat, 11 Oct 2014 01:36:26 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:36:26 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:36:26 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", Sat, 11 Oct 2014 01:36:26 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:query=>"stuff", :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.1ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/assignments", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/users", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/users/123/profile", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/students", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): put ["/api/v1/courses/1/assignments/2/submissions/3", {:body=>{}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): post ["/api/v1/courses/123/assignments", {:body=>{:assignment=>{:name=>"Assignment"}}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/sections", {:query=>{:include=>["students", "avatar_url"], :per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml  (0.3ms) begin transaction CanvasOauth::Authorization Load (23.9ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Rendered text template (0.0ms) Completed 200 OK in 9ms (Views: 9.0ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"}  (0.0ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 34ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"invalid"} Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"} Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.1ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"mismatch"} Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (3.7ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:37:32 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:37:32 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:37:32 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (1.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:37:32 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:37:32 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:37:32 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:37:32 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:37:32 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:37:32 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:37:32 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:37:32 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:37:32 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.6ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:37:32 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:37:32 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:37:32 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:37:32 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:37:32 UTC +00:00], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:37:32 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = ?, "updated_at" = ? WHERE "canvas_oauth_authorizations"."id" = 2 [["last_used_at", Sat, 11 Oct 2014 01:37:32 UTC +00:00], ["updated_at", Sat, 11 Oct 2014 01:37:32 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:37:32 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:37:32 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", Sat, 11 Oct 2014 01:37:32 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:query=>"stuff", :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.04ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/students", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): put ["/api/v1/courses/1/assignments/2/submissions/3", {:body=>{}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): post ["/api/v1/courses/123/assignments", {:body=>{:assignment=>{:name=>"Assignment"}}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/users/123/profile", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/assignments", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/sections", {:query=>{:include=>["students", "avatar_url"], :per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction API call (0.06ms): get ["/api/v1/courses/123", {:headers=>{}}]  (0.1ms) rollback transaction  (0.0ms) begin transaction API call (0.07ms): get ["/api/v1/accounts/1/users", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml Connecting to database specified by database.yml  (0.3ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Rendered text template (0.0ms) Completed 200 OK in 11.2ms (Views: 10.9ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"invalid"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"}  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 17.0ms (ActiveRecord: 0.1ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"} Completed 200 OK in 0.3ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"mismatch"} Completed 200 OK in 0.2ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 1.3ms (ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (29.5ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:40:07 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:40:07 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", Sat, 11 Oct 2014 01:40:07 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.4ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:40:07 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:40:07 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:40:07 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:40:07 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:40:07 UTC +00:00], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:40:07 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = '2014-10-11 01:40:07.320954', "updated_at" = '2014-10-11 01:40:07.321532' WHERE "canvas_oauth_authorizations"."id" = 2  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.3ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:40:07 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:40:07 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:40:07 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:40:07 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:40:07 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:40:07 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:40:07 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:40:07 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:40:07 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", Sat, 11 Oct 2014 01:40:07 UTC +00:00], ["last_used_at", Sat, 11 Oct 2014 01:40:07 UTC +00:00], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", Sat, 11 Oct 2014 01:40:07 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): post ["/api/v1/courses/123/assignments", {:body=>{:assignment=>{:name=>"Assignment"}}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.04ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:query=>"stuff", :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/assignments", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/sections", {:query=>{:include=>["students", "avatar_url"], :per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/users/123/profile", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/users", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/students", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): put ["/api/v1/courses/1/assignments/2/submissions/3", {:body=>{}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml  (0.2ms) begin transaction CanvasOauth::Authorization Load (1.5ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Rendered text template (0.0ms) Completed 200 OK in 7ms (Views: 7.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 11ms (ActiveRecord: 0.3ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"invalid"} Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"} Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.1ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"mismatch"} Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", "2014-10-11 01:43:05.757745"], ["last_used_at", "2014-10-11 01:43:05.757325"], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", "2014-10-11 01:43:05.757745"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (1.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", "2014-10-11 01:43:05.792800"], ["last_used_at", "2014-10-11 01:43:05.792223"], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", "2014-10-11 01:43:05.792800"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", "2014-10-11 01:43:05.795938"], ["last_used_at", "2014-10-11 01:43:05.795640"], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", "2014-10-11 01:43:05.795938"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", "2014-10-11 01:43:05.797963"], ["last_used_at", "2014-10-11 01:43:05.797682"], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", "2014-10-11 01:43:05.797963"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.3ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", "2014-10-11 01:43:05.799922"], ["last_used_at", "2014-10-11 01:43:05.799645"], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", "2014-10-11 01:43:05.799922"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", "2014-10-11 01:43:05.800759"], ["last_used_at", "2014-10-11 01:43:05.800532"], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", "2014-10-11 01:43:05.800759"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = ?, "updated_at" = ? WHERE "canvas_oauth_authorizations"."id" = 2 [["last_used_at", "2014-10-11 01:43:05.802583"], ["updated_at", "2014-10-11 01:43:05.802917"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", "2014-10-11 01:43:05.806023"], ["last_used_at", "2014-10-11 01:43:05.805627"], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", "2014-10-11 01:43:05.806023"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/users", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): post ["/api/v1/courses/123/assignments", {:body=>{:assignment=>{:name=>"Assignment"}}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/students", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/assignments", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:query=>"stuff", :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.04ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.1ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/users/123/profile", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/sections", {:query=>{:include=>["students", "avatar_url"], :per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): put ["/api/v1/courses/1/assignments/2/submissions/3", {:body=>{}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml  (0.2ms) begin transaction CanvasOauth::Authorization Load (1.4ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Rendered text template (0.0ms) Completed 200 OK in 8ms (Views: 7.6ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 12ms (ActiveRecord: 0.3ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"invalid"} Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"} Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.1ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"mismatch"} Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", "2014-10-11 01:44:49.593203"], ["last_used_at", "2014-10-11 01:44:49.592771"], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", "2014-10-11 01:44:49.593203"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (1.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", "2014-10-11 01:44:49.601006"], ["last_used_at", "2014-10-11 01:44:49.600458"], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", "2014-10-11 01:44:49.601006"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", "2014-10-11 01:44:49.603914"], ["last_used_at", "2014-10-11 01:44:49.603503"], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", "2014-10-11 01:44:49.603914"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", "2014-10-11 01:44:49.607063"], ["last_used_at", "2014-10-11 01:44:49.606676"], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", "2014-10-11 01:44:49.607063"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", "2014-10-11 01:44:49.609278"], ["last_used_at", "2014-10-11 01:44:49.608978"], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", "2014-10-11 01:44:49.609278"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", "2014-10-11 01:44:49.610189"], ["last_used_at", "2014-10-11 01:44:49.609919"], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", "2014-10-11 01:44:49.610189"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = ?, "updated_at" = ? WHERE "canvas_oauth_authorizations"."id" = 2 [["last_used_at", "2014-10-11 01:44:49.611875"], ["updated_at", "2014-10-11 01:44:49.612113"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.1ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", "2014-10-11 01:44:49.616050"], ["last_used_at", "2014-10-11 01:44:49.615664"], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", "2014-10-11 01:44:49.616050"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:query=>"stuff", :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.08ms): get ["/path", {:headers=>{}}]  (0.1ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/users", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/assignments", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/students", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/users/123/profile", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): post ["/api/v1/courses/123/assignments", {:body=>{:assignment=>{:name=>"Assignment"}}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): put ["/api/v1/courses/1/assignments/2/submissions/3", {:body=>{}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/sections", {:query=>{:include=>["students", "avatar_url"], :per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml  (0.3ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", "2014-10-11 01:45:25.086887"], ["last_used_at", "2014-10-11 01:45:25.086493"], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", "2014-10-11 01:45:25.086887"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (1.1ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", "2014-10-11 01:45:25.100136"], ["last_used_at", "2014-10-11 01:45:25.099495"], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", "2014-10-11 01:45:25.100136"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", "2014-10-11 01:45:25.101322"], ["last_used_at", "2014-10-11 01:45:25.101073"], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", "2014-10-11 01:45:25.101322"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = ?, "updated_at" = ? WHERE "canvas_oauth_authorizations"."id" = 2 [["last_used_at", "2014-10-11 01:45:25.103160"], ["updated_at", "2014-10-11 01:45:25.103467"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", "2014-10-11 01:45:25.106495"], ["last_used_at", "2014-10-11 01:45:25.106219"], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", "2014-10-11 01:45:25.106495"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", "2014-10-11 01:45:25.108940"], ["last_used_at", "2014-10-11 01:45:25.108575"], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", "2014-10-11 01:45:25.108940"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.0ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", "2014-10-11 01:45:25.111074"], ["last_used_at", "2014-10-11 01:45:25.110824"], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", "2014-10-11 01:45:25.111074"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", "2014-10-11 01:45:25.112989"], ["last_used_at", "2014-10-11 01:45:25.112694"], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", "2014-10-11 01:45:25.112989"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/sections", {:query=>{:include=>["students", "avatar_url"], :per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/users/123/profile", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/assignments", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): put ["/api/v1/courses/1/assignments/2/submissions/3", {:body=>{}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): post ["/api/v1/courses/123/assignments", {:body=>{:assignment=>{:name=>"Assignment"}}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/students", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/users", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.11ms): get ["/path", {:headers=>{}}]  (0.1ms) rollback transaction  (0.0ms) begin transaction API call (0.1ms): get ["/path", {:query=>"stuff", :headers=>{}}]  (0.1ms) rollback transaction  (0.1ms) begin transaction API call (0.06ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml  (0.2ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", "2014-10-11 01:46:49.635518"], ["last_used_at", "2014-10-11 01:46:49.635084"], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", "2014-10-11 01:46:49.635518"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", "2014-10-11 01:46:49.665707"], ["last_used_at", "2014-10-11 01:46:49.665283"], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", "2014-10-11 01:46:49.665707"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = ?, "updated_at" = ? WHERE "canvas_oauth_authorizations"."id" = 2 [["last_used_at", "2014-10-11 01:46:49.674680"], ["updated_at", "2014-10-11 01:46:49.675114"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.9ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", "2014-10-11 01:46:49.680310"], ["last_used_at", "2014-10-11 01:46:49.679843"], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", "2014-10-11 01:46:49.680310"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", "2014-10-11 01:46:49.682542"], ["last_used_at", "2014-10-11 01:46:49.682276"], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", "2014-10-11 01:46:49.682542"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", "2014-10-11 01:46:49.685153"], ["last_used_at", "2014-10-11 01:46:49.684797"], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", "2014-10-11 01:46:49.685153"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", "2014-10-11 01:46:49.687191"], ["last_used_at", "2014-10-11 01:46:49.686905"], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", "2014-10-11 01:46:49.687191"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", "2014-10-11 01:46:49.689270"], ["last_used_at", "2014-10-11 01:46:49.688957"], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", "2014-10-11 01:46:49.689270"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Rendered text template (0.0ms) Completed 200 OK in 43ms (Views: 43.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"} Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"invalid"} Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.1ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"mismatch"} Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.1ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/users", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): post ["/api/v1/courses/123/assignments", {:body=>{:assignment=>{:name=>"Assignment"}}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/sections", {:query=>{:include=>["students", "avatar_url"], :per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/users/123/profile", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): put ["/api/v1/courses/1/assignments/2/submissions/3", {:body=>{}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/students", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:query=>"stuff", :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.05ms): get ["/path", {:headers=>{}}]  (0.1ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/assignments", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml  (0.3ms) begin transaction CanvasOauth::Authorization Load (3.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Rendered text template (0.0ms) Completed 200 OK in 13ms (Views: 12.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"}  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 18ms (ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"invalid"} Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"} Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"mismatch"} Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", "2015-01-12 20:37:32.550525"], ["last_used_at", "2015-01-12 20:37:32.550067"], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", "2015-01-12 20:37:32.550525"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.9ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", "2015-01-12 20:37:32.560445"], ["last_used_at", "2015-01-12 20:37:32.559813"], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", "2015-01-12 20:37:32.560445"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", "2015-01-12 20:37:32.563274"], ["last_used_at", "2015-01-12 20:37:32.562927"], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", "2015-01-12 20:37:32.563274"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.5ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", "2015-01-12 20:37:32.566608"], ["last_used_at", "2015-01-12 20:37:32.566220"], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", "2015-01-12 20:37:32.566608"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", "2015-01-12 20:37:32.569427"], ["last_used_at", "2015-01-12 20:37:32.569065"], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", "2015-01-12 20:37:32.569427"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", "2015-01-12 20:37:32.570510"], ["last_used_at", "2015-01-12 20:37:32.570199"], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", "2015-01-12 20:37:32.570510"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = ?, "updated_at" = ? WHERE "canvas_oauth_authorizations"."id" = 2 [["last_used_at", "2015-01-12 20:37:32.572718"], ["updated_at", "2015-01-12 20:37:32.573039"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", "2015-01-12 20:37:32.575927"], ["last_used_at", "2015-01-12 20:37:32.575561"], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", "2015-01-12 20:37:32.575927"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.04ms): get ["/path", {:query=>"stuff", :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.08ms): get ["/api/v1/courses/123", {:headers=>{}}]  (0.1ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.1ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/students", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/assignments", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): put ["/api/v1/courses/1/assignments/2/submissions/3", {:body=>{}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/courses/123/sections", {:query=>{:include=>["students", "avatar_url", "enrollments"], :per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): post ["/api/v1/courses/123/assignments", {:body=>{:assignment=>{:name=>"Assignment"}}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.06ms): get ["/api/v1/accounts/1/users", {:query=>{:per_page=>50}, :headers=>{}}]  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction API call (0.06ms): get ["/api/v1/users/123/profile", {:headers=>{}}]  (0.1ms) rollback transaction Initializing Canvas using configuration in /Users/simon/Instructure/projects/canvas_oauth_engine/spec/dummy/config/canvas.yml  (0.3ms) begin transaction CanvasOauth::Authorization Load (2.9ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Rendered text template (0.0ms) Completed 200 OK in 9ms (Views: 8.6ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"}  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 29ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"invalid"} Completed 200 OK in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"} Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid"} Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"zzyyxx"}  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.1ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" IS NULL AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" IS NULL ORDER BY created_at DESC LIMIT 1 Processing by CanvasOauth::CanvasController#oauth as HTML Parameters: {"code"=>"valid", "state"=>"mismatch"} Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Processing by CanvasOauth::CanvasController#oauth as HTML Completed 200 OK in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", "2015-08-20 23:05:23.484089"], ["last_used_at", "2015-08-20 23:05:23.483817"], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", "2015-08-20 23:05:23.484089"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.7ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", "2015-08-20 23:05:23.496170"], ["last_used_at", "2015-08-20 23:05:23.495840"], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", "2015-08-20 23:05:23.496170"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", "2015-08-20 23:05:23.498854"], ["last_used_at", "2015-08-20 23:05:23.498666"], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", "2015-08-20 23:05:23.498854"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", "2015-08-20 23:05:23.500963"], ["last_used_at", "2015-08-20 23:05:23.500742"], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", "2015-08-20 23:05:23.500963"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" ORDER BY "canvas_oauth_authorizations"."id" ASC LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", "2015-08-20 23:05:23.503087"], ["last_used_at", "2015-08-20 23:05:23.502904"], ["token", "abc"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", "2015-08-20 23:05:23.503087"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", "2015-08-20 23:05:23.503931"], ["last_used_at", "2015-08-20 23:05:23.503773"], ["token", "def"], ["tool_consumer_instance_guid", "abc123"], ["updated_at", "2015-08-20 23:05:23.503931"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.2ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.1ms) UPDATE "canvas_oauth_authorizations" SET "last_used_at" = ?, "updated_at" = ? WHERE "canvas_oauth_authorizations"."id" = 2 [["last_used_at", "2015-08-20 23:05:23.506114"], ["updated_at", "2015-08-20 23:05:23.506363"]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.0ms) begin transaction CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "canvas_oauth_authorizations" ("canvas_user_id", "created_at", "last_used_at", "token", "tool_consumer_instance_guid", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["canvas_user_id", 123], ["created_at", "2015-08-20 23:05:23.509973"], ["last_used_at", "2015-08-20 23:05:23.509726"], ["token", "abc"], ["tool_consumer_instance_guid", "wrong"], ["updated_at", "2015-08-20 23:05:23.509973"]]  (0.0ms) RELEASE SAVEPOINT active_record_1 CanvasOauth::Authorization Load (0.1ms) SELECT "canvas_oauth_authorizations".* FROM "canvas_oauth_authorizations" WHERE "canvas_oauth_authorizations"."canvas_user_id" = 123 AND "canvas_oauth_authorizations"."tool_consumer_instance_guid" = 'abc123' ORDER BY created_at DESC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/path", {:query=>"stuff", :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.04ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/path", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): put ["/api/v1/courses/1/assignments/2/submissions/3", {:body=>{}, :headers=>{}}]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/api/v1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/api/v1/courses/123/sections", {:query=>{:include=>["students", "avatar_url", "enrollments"], :per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/api/v1/courses/123/assignments", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/api/v1/courses/123/students", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/api/v1/users/123/profile", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.03ms): get ["/api/v1/accounts/1/courses", {:query=>{:per_page=>50}, :headers=>{}}]  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/api/v1/courses/123", {:headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): get ["/api/v1/accounts/1/users", {:query=>{:per_page=>50}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction API call (0.02ms): post ["/api/v1/courses/123/assignments", {:body=>{:assignment=>{:name=>"Assignment"}}, :headers=>{}}]  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction