spec/dummy/log/test.log in bookingsync-engine-2.0.2 vs spec/dummy/log/test.log in bookingsync-engine-3.0.0

- old
+ new

@@ -10072,5 +10072,2852 @@  (0.0ms) ROLLBACK  (0.0ms) BEGIN  (0.1ms) ROLLBACK  (0.0ms) BEGIN  (0.0ms) ROLLBACK +  (0.1ms) BEGIN +  (0.4ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as HTML +Completed 500 Internal Server Error in 92ms (ActiveRecord: 0.0ms) +  (0.3ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as HTML +Redirected to http://test.host/auth/bookingsync/?account_id= +Filter chain halted as :authenticate_account! rendered or redirected +Completed 302 Found in 1ms (ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#failure as HTML + Rendering /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application + Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Completed 200 OK in 20ms (Views: 15.1ms | ActiveRecord: 0.0ms) +  (0.3ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#failure as HTML + Rendering /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application + Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.2ms) BEGIN +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#destroy as HTML +Redirected to http://test.host/ +Completed 302 Found in 0ms (ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#destroy as HTML +Redirected to http://test.host/signed_out +Completed 302 Found in 0ms (ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN + Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2017-06-21 02:19:36.643626"], ["updated_at", "2017-06-21 02:19:36.643626"]] +  (0.2ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.5ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2017-06-21 02:19:36.645811"], ["synced_id", 0], ["id", 1]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]] +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2017-06-21 02:19:36.661896"], ["updated_at", "2017-06-21 02:19:36.661896"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1497925176"]] +  (0.7ms) COMMIT +  (0.2ms) BEGIN + Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 2], ["LIMIT", 1]] + SQL (1.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2017-06-21 02:19:36.687108"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1498184376"], ["id", 2]] +  (0.6ms) COMMIT + Account Load (0.4ms) SELECT "accounts".* FROM "accounts" +  (0.1ms) BEGIN + SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 2]] +  (0.4ms) COMMIT +  (0.1ms) BEGIN + Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2017-06-21 02:19:36.696527"], ["updated_at", "2017-06-21 02:19:36.696527"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1497925176"]] +  (0.4ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) BEGIN + Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 3], ["LIMIT", 1]] + SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2017-06-21 02:19:36.703522"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1498184376"], ["id", 3]] +  (0.4ms) COMMIT +  (0.1ms) ROLLBACK + Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 3], ["LIMIT", 1]] + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" +  (0.1ms) BEGIN + SQL (0.4ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 3]] +  (0.4ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2017-06-21 02:19:36.713228"], ["updated_at", "2017-06-21 02:19:36.713228"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1498097976"]] +  (0.2ms) RELEASE SAVEPOINT active_record_1 +  (0.4ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:19:36.721320"], ["updated_at", "2017-06-21 02:19:36.721320"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.2ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:19:36.724365"], ["updated_at", "2017-06-21 02:19:36.724365"], ["provider", "bookingsync"], ["synced_id", 123]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 6], ["LIMIT", 1]] + SQL (0.4ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2017-06-21 02:19:36.728056"], ["id", 6]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:19:36.733089"], ["updated_at", "2017-06-21 02:19:36.733089"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:19:36.735187"], ["updated_at", "2017-06-21 02:19:36.735187"], ["provider", "bookingsync"], ["synced_id", 123]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 8], ["LIMIT", 1]] + SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2017-06-21 02:19:36.738542"], ["id", 8]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 8], ["LIMIT", 1]] +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:19:36.742836"], ["updated_at", "2017-06-21 02:19:36.742836"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:19:36.744833"], ["updated_at", "2017-06-21 02:19:36.744833"], ["provider", "bookingsync"], ["synced_id", 123]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 10], ["LIMIT", 1]] + SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2017-06-21 02:19:36.747646"], ["id", 10]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 10], ["LIMIT", 1]] +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:19:36.752218"], ["updated_at", "2017-06-21 02:19:36.752218"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.4ms) SELECT COUNT(*) FROM "accounts" + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:19:36.758660"], ["updated_at", "2017-06-21 02:19:36.758660"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.2ms) SELECT COUNT(*) FROM "accounts" +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:19:36.762787"], ["updated_at", "2017-06-21 02:19:36.762787"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.2ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:19:36.766658"], ["updated_at", "2017-06-21 02:19:36.766658"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:19:36.770223"], ["updated_at", "2017-06-21 02:19:36.770223"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:19:36.773505"], ["updated_at", "2017-06-21 02:19:36.773505"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:19:36.776872"], ["updated_at", "2017-06-21 02:19:36.776872"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:19:36.780411"], ["updated_at", "2017-06-21 02:19:36.780411"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] + SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2017-06-21 02:19:36.826505"], ["updated_at", "2017-06-21 02:19:36.826505"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 19], ["LIMIT", 1]] + SQL (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2017-06-21 02:19:36.828250"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 19]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 19], ["LIMIT", 1]] +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as HTML +Completed 500 Internal Server Error in 84ms (ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as HTML +Redirected to http://test.host/auth/bookingsync/?account_id= +Filter chain halted as :authenticate_account! rendered or redirected +Completed 302 Found in 0ms (ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:20:07.987617"], ["updated_at", "2017-06-21 02:20:07.987617"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:20:07.991205"], ["updated_at", "2017-06-21 02:20:07.991205"], ["provider", "bookingsync"], ["synced_id", 123]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 2], ["LIMIT", 1]] + SQL (0.4ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2017-06-21 02:20:07.996172"], ["id", 2]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:20:08.001666"], ["updated_at", "2017-06-21 02:20:08.001666"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:20:08.003376"], ["updated_at", "2017-06-21 02:20:08.003376"], ["provider", "bookingsync"], ["synced_id", 123]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 4], ["LIMIT", 1]] + SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2017-06-21 02:20:08.005526"], ["id", 4]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 4], ["LIMIT", 1]] +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:20:08.008883"], ["updated_at", "2017-06-21 02:20:08.008883"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:20:08.010531"], ["updated_at", "2017-06-21 02:20:08.010531"], ["provider", "bookingsync"], ["synced_id", 123]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 6], ["LIMIT", 1]] + SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2017-06-21 02:20:08.012851"], ["id", 6]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 6], ["LIMIT", 1]] +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:20:08.016168"], ["updated_at", "2017-06-21 02:20:08.016168"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.4ms) SELECT COUNT(*) FROM "accounts" + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:20:08.022469"], ["updated_at", "2017-06-21 02:20:08.022469"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.3ms) SELECT COUNT(*) FROM "accounts" +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:20:08.026536"], ["updated_at", "2017-06-21 02:20:08.026536"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:20:08.028893"], ["updated_at", "2017-06-21 02:20:08.028893"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:20:08.031963"], ["updated_at", "2017-06-21 02:20:08.031963"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:20:08.035752"], ["updated_at", "2017-06-21 02:20:08.035752"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:20:08.038410"], ["updated_at", "2017-06-21 02:20:08.038410"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:20:08.040573"], ["updated_at", "2017-06-21 02:20:08.040573"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] + SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2017-06-21 02:20:08.043378"], ["updated_at", "2017-06-21 02:20:08.043378"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 15], ["LIMIT", 1]] + SQL (0.9ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2017-06-21 02:20:08.045009"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 15]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 15], ["LIMIT", 1]] +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2017-06-21 02:20:08.055253"], ["updated_at", "2017-06-21 02:20:08.055253"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2017-06-21 02:20:08.056896"], ["synced_id", 0], ["id", 16]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]] +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2017-06-21 02:20:08.067165"], ["updated_at", "2017-06-21 02:20:08.067165"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1498098008"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2017-06-21 02:20:08.070477"], ["updated_at", "2017-06-21 02:20:08.070477"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1497925208"]] +  (0.5ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) BEGIN + Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 18], ["LIMIT", 1]] + SQL (0.5ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2017-06-21 02:20:08.089827"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1498184408"], ["id", 18]] +  (0.5ms) COMMIT +  (0.1ms) ROLLBACK + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 18], ["LIMIT", 1]] + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" +  (0.1ms) BEGIN + SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 18]] +  (0.4ms) COMMIT +  (0.1ms) BEGIN + Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2017-06-21 02:20:08.097619"], ["updated_at", "2017-06-21 02:20:08.097619"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1497925208"]] +  (0.4ms) COMMIT +  (0.1ms) BEGIN + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 19], ["LIMIT", 1]] + SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2017-06-21 02:20:08.101740"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1498184408"], ["id", 19]] +  (0.4ms) COMMIT + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" +  (0.1ms) BEGIN + SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 19]] +  (0.3ms) COMMIT +  (0.1ms) BEGIN +Processing by SessionsController#destroy as HTML +Redirected to http://test.host/ +Completed 302 Found in 0ms (ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#destroy as HTML +Redirected to http://test.host/signed_out +Completed 302 Found in 0ms (ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.2ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.2ms) ROLLBACK +  (0.2ms) BEGIN +Processing by SessionsController#create as HTML + Parameters: {"provider"=>"bookingsync"} + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:20:08.122228"], ["updated_at", "2017-06-21 02:20:08.122228"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://test.host/ +Completed 302 Found in 4ms (ActiveRecord: 1.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#failure as HTML + Rendering /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application + Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Completed 200 OK in 12ms (Views: 7.8ms | ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#failure as HTML + Rendering /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application + Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.2ms) BEGIN +  (0.2ms) ROLLBACK +  (0.2ms) BEGIN +Processing by AuthenticatedController#index as HTML +Completed 500 Internal Server Error in 82ms (ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as HTML +Redirected to http://test.host/auth/bookingsync/?account_id= +Filter chain halted as :authenticate_account! rendered or redirected +Completed 302 Found in 0ms (ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#failure as HTML + Rendering /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application + Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Completed 200 OK in 13ms (Views: 7.7ms | ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#failure as HTML + Rendering /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application + Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#destroy as HTML +Redirected to http://test.host/signed_out +Completed 302 Found in 0ms (ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#destroy as HTML +Redirected to http://test.host/ +Completed 302 Found in 0ms (ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#create as HTML + Parameters: {"provider"=>"bookingsync"} + Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.2ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:20:19.868263"], ["updated_at", "2017-06-21 02:20:19.868263"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://test.host/ +Completed 302 Found in 27ms (ActiveRecord: 7.7ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#create as HTML + Parameters: {"provider"=>"bookingsync"} + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:20:19.874300"], ["updated_at", "2017-06-21 02:20:19.874300"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://test.host/admin +Completed 302 Found in 4ms (ActiveRecord: 1.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#create as HTML + Parameters: {"provider"=>"bookingsync"} + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:20:19.879831"], ["updated_at", "2017-06-21 02:20:19.879831"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://test.host/ +Completed 302 Found in 3ms (ActiveRecord: 0.9ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2017-06-21 02:20:19.920066"], ["updated_at", "2017-06-21 02:20:19.920066"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1497925219"]] +  (0.4ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) BEGIN + Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 4], ["LIMIT", 1]] + SQL (0.5ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2017-06-21 02:20:19.935190"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1498184419"], ["id", 4]] +  (0.4ms) COMMIT +  (0.1ms) ROLLBACK + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 4], ["LIMIT", 1]] + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" +  (0.1ms) BEGIN + SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 4]] +  (0.3ms) COMMIT +  (0.1ms) BEGIN + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2017-06-21 02:20:19.942817"], ["updated_at", "2017-06-21 02:20:19.942817"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1497925219"]] +  (0.5ms) COMMIT +  (0.1ms) BEGIN + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 5], ["LIMIT", 1]] + SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2017-06-21 02:20:19.946162"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1498184419"], ["id", 5]] +  (0.4ms) COMMIT + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" +  (0.1ms) BEGIN + SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 5]] +  (0.3ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2017-06-21 02:20:19.951076"], ["updated_at", "2017-06-21 02:20:19.951076"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1498098019"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:20:19.953761"], ["updated_at", "2017-06-21 02:20:19.953761"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.3ms) SELECT COUNT(*) FROM "accounts" + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:20:19.959987"], ["updated_at", "2017-06-21 02:20:19.959987"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.2ms) SELECT COUNT(*) FROM "accounts" +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:20:19.963742"], ["updated_at", "2017-06-21 02:20:19.963742"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:20:19.966656"], ["updated_at", "2017-06-21 02:20:19.966656"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:20:19.970140"], ["updated_at", "2017-06-21 02:20:19.970140"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:20:19.972942"], ["updated_at", "2017-06-21 02:20:19.972942"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.2ms) BEGIN +  (0.2ms) SAVEPOINT active_record_1 + Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:20:19.977403"], ["updated_at", "2017-06-21 02:20:19.977403"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:20:19.980414"], ["updated_at", "2017-06-21 02:20:19.980414"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:20:19.983784"], ["updated_at", "2017-06-21 02:20:19.983784"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:20:19.985761"], ["updated_at", "2017-06-21 02:20:19.985761"], ["provider", "bookingsync"], ["synced_id", 123]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 16], ["LIMIT", 1]] + SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2017-06-21 02:20:19.988682"], ["id", 16]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:20:19.992397"], ["updated_at", "2017-06-21 02:20:19.992397"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:20:19.994359"], ["updated_at", "2017-06-21 02:20:19.994359"], ["provider", "bookingsync"], ["synced_id", 123]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 18], ["LIMIT", 1]] + SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2017-06-21 02:20:19.997001"], ["id", 18]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 18], ["LIMIT", 1]] +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:20:20.001261"], ["updated_at", "2017-06-21 02:20:20.001261"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:20:20.003740"], ["updated_at", "2017-06-21 02:20:20.003740"], ["provider", "bookingsync"], ["synced_id", 123]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 20], ["LIMIT", 1]] + SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2017-06-21 02:20:20.006730"], ["id", 20]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 20], ["LIMIT", 1]] +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2017-06-21 02:20:20.011868"], ["updated_at", "2017-06-21 02:20:20.011868"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 21], ["LIMIT", 1]] + SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2017-06-21 02:20:20.014037"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 21]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 21], ["LIMIT", 1]] +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2017-06-21 02:20:20.022629"], ["updated_at", "2017-06-21 02:20:20.022629"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2017-06-21 02:20:20.024564"], ["synced_id", 0], ["id", 22]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]] +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#destroy as HTML +Redirected to http://test.host/signed_out +Completed 302 Found in 1ms (ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#destroy as HTML +Redirected to http://test.host/ +Completed 302 Found in 1ms (ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#failure as HTML + Rendering /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application + Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Completed 200 OK in 15ms (Views: 10.3ms | ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#failure as HTML + Rendering /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application + Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#create as HTML + Parameters: {"provider"=>"bookingsync"} + Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.2ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:23:17.480247"], ["updated_at", "2017-06-21 02:23:17.480247"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://test.host/admin +Completed 302 Found in 31ms (ActiveRecord: 8.1ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#create as HTML + Parameters: {"provider"=>"bookingsync"} + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:23:17.485976"], ["updated_at", "2017-06-21 02:23:17.485976"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://test.host/ +Completed 302 Found in 3ms (ActiveRecord: 0.8ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#create as HTML + Parameters: {"provider"=>"bookingsync"} + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:23:17.493393"], ["updated_at", "2017-06-21 02:23:17.493393"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://test.host/ +Completed 302 Found in 5ms (ActiveRecord: 1.3ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2017-06-21 02:23:17.504762"], ["updated_at", "2017-06-21 02:23:17.504762"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1497925397"]] +  (0.5ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) BEGIN + Account Exists (1.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 4], ["LIMIT", 1]] + SQL (0.7ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2017-06-21 02:23:17.523270"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1498184597"], ["id", 4]] +  (0.5ms) COMMIT +  (0.1ms) ROLLBACK + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 4], ["LIMIT", 1]] + Account Load (0.4ms) SELECT "accounts".* FROM "accounts" +  (0.1ms) BEGIN + SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 4]] +  (0.4ms) COMMIT +  (0.1ms) BEGIN + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2017-06-21 02:23:17.534598"], ["updated_at", "2017-06-21 02:23:17.534598"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1497925397"]] +  (0.5ms) COMMIT +  (0.1ms) BEGIN + Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 5], ["LIMIT", 1]] + SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2017-06-21 02:23:17.538920"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1498184597"], ["id", 5]] +  (0.3ms) COMMIT + Account Load (0.4ms) SELECT "accounts".* FROM "accounts" +  (0.2ms) BEGIN + SQL (0.7ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 5]] +  (0.5ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2017-06-21 02:23:17.546895"], ["updated_at", "2017-06-21 02:23:17.546895"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1498098197"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2017-06-21 02:23:17.597283"], ["updated_at", "2017-06-21 02:23:17.597283"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2017-06-21 02:23:17.598737"], ["synced_id", 0], ["id", 7]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]] +  (0.4ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2017-06-21 02:23:17.609767"], ["updated_at", "2017-06-21 02:23:17.609767"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 8], ["LIMIT", 1]] + SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2017-06-21 02:23:17.612116"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 8]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 8], ["LIMIT", 1]] +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:23:17.616356"], ["updated_at", "2017-06-21 02:23:17.616356"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.3ms) RELEASE SAVEPOINT active_record_1 +  (0.4ms) SELECT COUNT(*) FROM "accounts" + Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.2ms) SAVEPOINT active_record_1 + Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:23:17.625181"], ["updated_at", "2017-06-21 02:23:17.625181"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.2ms) SELECT COUNT(*) FROM "accounts" +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:23:17.628790"], ["updated_at", "2017-06-21 02:23:17.628790"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:23:17.631432"], ["updated_at", "2017-06-21 02:23:17.631432"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:23:17.634151"], ["updated_at", "2017-06-21 02:23:17.634151"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:23:17.636293"], ["updated_at", "2017-06-21 02:23:17.636293"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:23:17.638760"], ["updated_at", "2017-06-21 02:23:17.638760"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:23:17.641427"], ["updated_at", "2017-06-21 02:23:17.641427"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:23:17.644994"], ["updated_at", "2017-06-21 02:23:17.644994"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:23:17.646646"], ["updated_at", "2017-06-21 02:23:17.646646"], ["provider", "bookingsync"], ["synced_id", 123]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 18], ["LIMIT", 1]] + SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2017-06-21 02:23:17.648990"], ["id", 18]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:23:17.651870"], ["updated_at", "2017-06-21 02:23:17.651870"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:23:17.653549"], ["updated_at", "2017-06-21 02:23:17.653549"], ["provider", "bookingsync"], ["synced_id", 123]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 20], ["LIMIT", 1]] + SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2017-06-21 02:23:17.656079"], ["id", 20]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 20], ["LIMIT", 1]] +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:23:17.659770"], ["updated_at", "2017-06-21 02:23:17.659770"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:23:17.661461"], ["updated_at", "2017-06-21 02:23:17.661461"], ["provider", "bookingsync"], ["synced_id", 123]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 22], ["LIMIT", 1]] + SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2017-06-21 02:23:17.663542"], ["id", 22]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 22], ["LIMIT", 1]] +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as HTML +Completed 500 Internal Server Error in 73ms (ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as HTML +Redirected to http://test.host/auth/bookingsync/?account_id= +Filter chain halted as :authenticate_account! rendered or redirected +Completed 302 Found in 0ms (ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as JS +Completed 500 Internal Server Error in 1ms (ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as JS +Completed 500 Internal Server Error in 1ms (ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as HTML +Completed 500 Internal Server Error in 94ms (ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as HTML +Completed 500 Internal Server Error in 88ms (ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as HTML +Completed 500 Internal Server Error in 93ms (ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as HTML +Completed 500 Internal Server Error in 93ms (ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as HTML +Completed 500 Internal Server Error in 97ms (ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as HTML + Rendering text template + Rendered text template (0.0ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Filter chain halted as :authenticate_account! rendered or redirected +Completed 200 OK in 5ms (Views: 4.9ms | ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as JS +Completed 500 Internal Server Error in 87ms (ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as JS +Completed 500 Internal Server Error in 1ms (ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as HTML +Redirected to http://test.host/auth/bookingsync/?account_id= +Filter chain halted as :authenticate_account! rendered or redirected +Completed 302 Found in 0ms (ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as HTML + Rendering text template + Rendered text template (0.0ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Filter chain halted as :authenticate_account! rendered or redirected +Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#create as HTML + Parameters: {"provider"=>"bookingsync"} + Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.2ms) SAVEPOINT active_record_1 + Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:27:23.136115"], ["updated_at", "2017-06-21 02:27:23.136115"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://test.host/ +Completed 302 Found in 34ms (ActiveRecord: 9.8ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#create as HTML + Parameters: {"provider"=>"bookingsync"} + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:27:23.142909"], ["updated_at", "2017-06-21 02:27:23.142909"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://test.host/admin +Completed 302 Found in 4ms (ActiveRecord: 1.0ms) +  (0.1ms) ROLLBACK +  (0.2ms) BEGIN +Processing by SessionsController#create as HTML + Parameters: {"provider"=>"bookingsync"} + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.2ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:27:23.151387"], ["updated_at", "2017-06-21 02:27:23.151387"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://test.host/ +Completed 302 Found in 4ms (ActiveRecord: 1.3ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#failure as HTML + Rendering /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application + Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Completed 200 OK in 12ms (Views: 7.6ms | ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#failure as HTML + Rendering /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application + Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#destroy as HTML +Redirected to http://test.host/ +Completed 302 Found in 0ms (ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#destroy as HTML +Redirected to http://test.host/signed_out +Completed 302 Found in 0ms (ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:27:23.215194"], ["updated_at", "2017-06-21 02:27:23.215194"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.3ms) SELECT COUNT(*) FROM "accounts" + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:27:23.220939"], ["updated_at", "2017-06-21 02:27:23.220939"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.2ms) SELECT COUNT(*) FROM "accounts" +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:27:23.224850"], ["updated_at", "2017-06-21 02:27:23.224850"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:27:23.228385"], ["updated_at", "2017-06-21 02:27:23.228385"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.2ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:27:23.232602"], ["updated_at", "2017-06-21 02:27:23.232602"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:27:23.235476"], ["updated_at", "2017-06-21 02:27:23.235476"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:27:23.238420"], ["updated_at", "2017-06-21 02:27:23.238420"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:27:23.242101"], ["updated_at", "2017-06-21 02:27:23.242101"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.2ms) SAVEPOINT active_record_1 + Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:27:23.247086"], ["updated_at", "2017-06-21 02:27:23.247086"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:27:23.249768"], ["updated_at", "2017-06-21 02:27:23.249768"], ["provider", "bookingsync"], ["synced_id", 123]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 13], ["LIMIT", 1]] + SQL (0.6ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2017-06-21 02:27:23.254162"], ["id", 13]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:27:23.259224"], ["updated_at", "2017-06-21 02:27:23.259224"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:27:23.261347"], ["updated_at", "2017-06-21 02:27:23.261347"], ["provider", "bookingsync"], ["synced_id", 123]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 15], ["LIMIT", 1]] + SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2017-06-21 02:27:23.265178"], ["id", 15]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 15], ["LIMIT", 1]] +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:27:23.270501"], ["updated_at", "2017-06-21 02:27:23.270501"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.2ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:27:23.273461"], ["updated_at", "2017-06-21 02:27:23.273461"], ["provider", "bookingsync"], ["synced_id", 123]] +  (0.2ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 17], ["LIMIT", 1]] + SQL (0.5ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2017-06-21 02:27:23.277738"], ["id", 17]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 17], ["LIMIT", 1]] +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2017-06-21 02:27:23.284523"], ["updated_at", "2017-06-21 02:27:23.284523"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 18], ["LIMIT", 1]] + SQL (0.8ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2017-06-21 02:27:23.287230"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 18]] +  (0.2ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 18], ["LIMIT", 1]] +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2017-06-21 02:27:23.293523"], ["updated_at", "2017-06-21 02:27:23.293523"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1497925643"]] +  (0.4ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) BEGIN + Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 19], ["LIMIT", 1]] + SQL (0.7ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2017-06-21 02:27:23.312796"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1498184843"], ["id", 19]] +  (0.5ms) COMMIT +  (0.1ms) ROLLBACK + Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 19], ["LIMIT", 1]] + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" +  (0.1ms) BEGIN + SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 19]] +  (0.4ms) COMMIT +  (0.1ms) BEGIN + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2017-06-21 02:27:23.321254"], ["updated_at", "2017-06-21 02:27:23.321254"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1497925643"]] +  (0.4ms) COMMIT +  (0.1ms) BEGIN + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 20], ["LIMIT", 1]] + SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2017-06-21 02:27:23.325176"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1498184843"], ["id", 20]] +  (0.4ms) COMMIT + Account Load (0.4ms) SELECT "accounts".* FROM "accounts" +  (0.5ms) BEGIN + SQL (0.6ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 20]] +  (0.6ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2017-06-21 02:27:23.334141"], ["updated_at", "2017-06-21 02:27:23.334141"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1498098443"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2017-06-21 02:27:23.341877"], ["updated_at", "2017-06-21 02:27:23.341877"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.5ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2017-06-21 02:27:23.343585"], ["synced_id", 0], ["id", 22]] +  (0.2ms) RELEASE SAVEPOINT active_record_1 + Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]] +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as HTML +Redirected to http://test.host/auth/bookingsync/?account_id= +Filter chain halted as :authenticate_account! rendered or redirected +Completed 302 Found in 1ms (ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as HTML + Rendering text template + Rendered text template (0.0ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Filter chain halted as :authenticate_account! rendered or redirected +Completed 200 OK in 3ms (Views: 2.8ms | ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as JS + Rendering text template + Rendered text template (0.0ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Filter chain halted as :authenticate_account! rendered or redirected +Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as JS + Rendering text template + Rendered text template (0.0ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Filter chain halted as :authenticate_account! rendered or redirected +Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.2ms) BEGIN +Processing by SessionsController#create as HTML + Parameters: {"provider"=>"bookingsync"} + Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.3ms) SAVEPOINT active_record_1 + Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:27:30.802913"], ["updated_at", "2017-06-21 02:27:30.802913"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://test.host/admin +Completed 302 Found in 44ms (ActiveRecord: 12.6ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#create as HTML + Parameters: {"provider"=>"bookingsync"} + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:27:30.813367"], ["updated_at", "2017-06-21 02:27:30.813367"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://test.host/ +Completed 302 Found in 6ms (ActiveRecord: 1.5ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#create as HTML + Parameters: {"provider"=>"bookingsync"} + Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:27:30.821852"], ["updated_at", "2017-06-21 02:27:30.821852"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://test.host/ +Completed 302 Found in 5ms (ActiveRecord: 1.3ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#destroy as HTML +Redirected to http://test.host/signed_out +Completed 302 Found in 0ms (ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.2ms) BEGIN +Processing by SessionsController#destroy as HTML +Redirected to http://test.host/ +Completed 302 Found in 1ms (ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#failure as HTML + Rendering /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application + Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Completed 200 OK in 13ms (Views: 7.8ms | ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#failure as HTML + Rendering /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application + Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] +  (0.2ms) SAVEPOINT active_record_1 + SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2017-06-21 02:27:30.871541"], ["updated_at", "2017-06-21 02:27:30.871541"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2017-06-21 02:27:30.873898"], ["synced_id", 0], ["id", 4]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]] +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:27:30.884216"], ["updated_at", "2017-06-21 02:27:30.884216"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.3ms) SELECT COUNT(*) FROM "accounts" + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:27:30.889831"], ["updated_at", "2017-06-21 02:27:30.889831"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.3ms) SELECT COUNT(*) FROM "accounts" +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:27:30.895920"], ["updated_at", "2017-06-21 02:27:30.895920"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:27:30.900309"], ["updated_at", "2017-06-21 02:27:30.900309"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:27:30.904510"], ["updated_at", "2017-06-21 02:27:30.904510"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:27:30.907593"], ["updated_at", "2017-06-21 02:27:30.907593"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:27:30.911178"], ["updated_at", "2017-06-21 02:27:30.911178"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.2ms) SAVEPOINT active_record_1 + Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:27:30.915170"], ["updated_at", "2017-06-21 02:27:30.915170"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:27:30.919617"], ["updated_at", "2017-06-21 02:27:30.919617"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:27:30.921835"], ["updated_at", "2017-06-21 02:27:30.921835"], ["provider", "bookingsync"], ["synced_id", 123]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 14], ["LIMIT", 1]] + SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2017-06-21 02:27:30.926543"], ["id", 14]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:27:30.930548"], ["updated_at", "2017-06-21 02:27:30.930548"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:27:30.932686"], ["updated_at", "2017-06-21 02:27:30.932686"], ["provider", "bookingsync"], ["synced_id", 123]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 16], ["LIMIT", 1]] + SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2017-06-21 02:27:30.935256"], ["id", 16]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 16], ["LIMIT", 1]] +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:27:30.939083"], ["updated_at", "2017-06-21 02:27:30.939083"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:27:30.941232"], ["updated_at", "2017-06-21 02:27:30.941232"], ["provider", "bookingsync"], ["synced_id", 123]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 18], ["LIMIT", 1]] + SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2017-06-21 02:27:30.944333"], ["id", 18]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 18], ["LIMIT", 1]] +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2017-06-21 02:27:30.950436"], ["updated_at", "2017-06-21 02:27:30.950436"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1498098450"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2017-06-21 02:27:30.954547"], ["updated_at", "2017-06-21 02:27:30.954547"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1497925650"]] +  (0.4ms) COMMIT +  (0.1ms) BEGIN + Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 20], ["LIMIT", 1]] + SQL (0.5ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2017-06-21 02:27:30.971996"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1498184850"], ["id", 20]] +  (0.5ms) COMMIT + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" +  (0.1ms) BEGIN + SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 20]] +  (0.3ms) COMMIT +  (0.1ms) BEGIN + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2017-06-21 02:27:30.978118"], ["updated_at", "2017-06-21 02:27:30.978118"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1497925650"]] +  (0.4ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) BEGIN + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 21], ["LIMIT", 1]] + SQL (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2017-06-21 02:27:30.982773"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1498184850"], ["id", 21]] +  (0.4ms) COMMIT +  (0.2ms) ROLLBACK + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 21], ["LIMIT", 1]] + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" +  (0.1ms) BEGIN + SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 21]] +  (0.4ms) COMMIT +  (0.1ms) BEGIN +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2017-06-21 02:27:31.024658"], ["updated_at", "2017-06-21 02:27:31.024658"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 22], ["LIMIT", 1]] + SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2017-06-21 02:27:31.027159"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 22]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 22], ["LIMIT", 1]] +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.5ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1498098649"], ["created_at", "2017-06-21 02:30:49.616800"], ["updated_at", "2017-06-21 02:30:49.616800"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1497925849"], ["created_at", "2017-06-21 02:30:49.620388"], ["updated_at", "2017-06-21 02:30:49.620388"]] +  (0.3ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) BEGIN + Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1 + SQL (0.4ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1498185049"], ["updated_at", "2017-06-21 02:30:49.636497"], ["id", 2]] +  (0.4ms) COMMIT +  (0.1ms) ROLLBACK + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 2]] + Account Load (0.4ms) SELECT "accounts".* FROM "accounts" +  (0.1ms) BEGIN + SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 2]] +  (0.3ms) COMMIT +  (0.1ms) BEGIN + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1497925849"], ["created_at", "2017-06-21 02:30:49.652613"], ["updated_at", "2017-06-21 02:30:49.652613"]] +  (0.5ms) COMMIT +  (0.1ms) BEGIN + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 3) LIMIT 1 + SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1498185049"], ["updated_at", "2017-06-21 02:30:49.656423"], ["id", 3]] +  (0.4ms) COMMIT + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" +  (0.1ms) BEGIN + SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 3]] +  (0.3ms) COMMIT +  (0.1ms) BEGIN + Account Load (0.5ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2017-06-21 02:30:49.665148"], ["updated_at", "2017-06-21 02:30:49.665148"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.2ms) UPDATE "accounts" SET "synced_id" = $1, "updated_at" = $2 WHERE "accounts"."id" = $3 [["synced_id", 0], ["updated_at", "2017-06-21 02:30:49.666807"], ["id", 4]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 0 LIMIT 1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2017-06-21 02:30:49.677833"], ["updated_at", "2017-06-21 02:30:49.677833"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2017-06-21 02:30:49.680142"], ["updated_at", "2017-06-21 02:30:49.680142"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 6) LIMIT 1 + SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2017-06-21 02:30:49.683451"], ["id", 6]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 + SQL (0.3ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2017-06-21 02:30:49.688104"], ["updated_at", "2017-06-21 02:30:49.688104"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2017-06-21 02:30:49.690535"], ["updated_at", "2017-06-21 02:30:49.690535"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 8) LIMIT 1 + SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2017-06-21 02:30:49.694351"], ["id", 8]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 8]] +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2017-06-21 02:30:49.698832"], ["updated_at", "2017-06-21 02:30:49.698832"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2017-06-21 02:30:49.700773"], ["updated_at", "2017-06-21 02:30:49.700773"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 10) LIMIT 1 + SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2017-06-21 02:30:49.703871"], ["id", 10]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 10]] +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2017-06-21 02:30:49.707776"], ["updated_at", "2017-06-21 02:30:49.707776"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.4ms) SELECT COUNT(*) FROM "accounts" + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2017-06-21 02:30:49.714113"], ["updated_at", "2017-06-21 02:30:49.714113"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.2ms) SELECT COUNT(*) FROM "accounts" +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2017-06-21 02:30:49.717888"], ["updated_at", "2017-06-21 02:30:49.717888"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2017-06-21 02:30:49.720711"], ["updated_at", "2017-06-21 02:30:49.720711"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2017-06-21 02:30:49.724310"], ["updated_at", "2017-06-21 02:30:49.724310"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2017-06-21 02:30:49.726817"], ["updated_at", "2017-06-21 02:30:49.726817"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2017-06-21 02:30:49.730113"], ["updated_at", "2017-06-21 02:30:49.730113"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2017-06-21 02:30:49.732838"], ["updated_at", "2017-06-21 02:30:49.732838"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["created_at", "2017-06-21 02:30:49.735719"], ["updated_at", "2017-06-21 02:30:49.735719"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 19) LIMIT 1 + SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2017-06-21 02:30:49.737730"], ["id", 19]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 19]] +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#create as HTML + Parameters: {"params"=>{"provider"=>"bookingsync"}} + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2017-06-21 02:30:49.762670"], ["updated_at", "2017-06-21 02:30:49.762670"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://test.host/admin +Completed 302 Found in 4ms (ActiveRecord: 0.9ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#create as HTML + Parameters: {"params"=>{"provider"=>"bookingsync"}} + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2017-06-21 02:30:49.771075"], ["updated_at", "2017-06-21 02:30:49.771075"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://test.host/ +Completed 302 Found in 4ms (ActiveRecord: 1.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#create as HTML + Parameters: {"params"=>{"provider"=>"bookingsync"}} + Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2017-06-21 02:30:49.780302"], ["updated_at", "2017-06-21 02:30:49.780302"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://test.host/ +Completed 302 Found in 4ms (ActiveRecord: 1.1ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#failure as HTML + Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) +Completed 200 OK in 19ms (Views: 18.5ms | ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#failure as HTML + Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) +Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#destroy as HTML +Redirected to http://test.host/ +Completed 302 Found in 0ms (ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#destroy as HTML +Redirected to http://test.host/signed_out +Completed 302 Found in 0ms (ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as HTML + Rendered text template (0.0ms) +Filter chain halted as :authenticate_account! rendered or redirected +Completed 200 OK in 4ms (Views: 3.7ms | ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as HTML +Redirected to http://test.host/auth/bookingsync/?account_id= +Filter chain halted as :authenticate_account! rendered or redirected +Completed 302 Found in 0ms (ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as HTML + Parameters: {"xhr"=>true} + Rendered text template (0.0ms) +Filter chain halted as :authenticate_account! rendered or redirected +Completed 200 OK in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as HTML + Parameters: {"xhr"=>true} +Redirected to http://test.host/auth/bookingsync/?account_id= +Filter chain halted as :authenticate_account! rendered or redirected +Completed 302 Found in 0ms (ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#destroy as HTML +Redirected to http://test.host/ +Completed 302 Found in 0ms (ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#destroy as HTML +Redirected to http://test.host/signed_out +Completed 302 Found in 0ms (ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#failure as HTML + Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Completed 200 OK in 15ms (Views: 15.1ms | ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#failure as HTML + Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#create as HTML + Parameters: {"params"=>{"provider"=>"bookingsync"}} + Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.4ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2017-06-21 02:32:02.315518"], ["updated_at", "2017-06-21 02:32:02.315518"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://test.host/admin +Completed 302 Found in 31ms (ActiveRecord: 5.6ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#create as HTML + Parameters: {"params"=>{"provider"=>"bookingsync"}} + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2017-06-21 02:32:02.323393"], ["updated_at", "2017-06-21 02:32:02.323393"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://test.host/ +Completed 302 Found in 3ms (ActiveRecord: 0.7ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#create as HTML + Parameters: {"params"=>{"provider"=>"bookingsync"}} + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2017-06-21 02:32:02.329835"], ["updated_at", "2017-06-21 02:32:02.329835"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://test.host/ +Completed 302 Found in 3ms (ActiveRecord: 0.7ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as HTML + Rendered text template (0.0ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Filter chain halted as :authenticate_account! rendered or redirected +Completed 200 OK in 4ms (Views: 4.0ms | ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as HTML +Redirected to http://test.host/auth/bookingsync/?account_id= +Filter chain halted as :authenticate_account! rendered or redirected +Completed 302 Found in 0ms (ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as HTML + Parameters: {"xhr"=>true} + Rendered text template (0.0ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Filter chain halted as :authenticate_account! rendered or redirected +Completed 200 OK in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as HTML + Parameters: {"xhr"=>true} +Redirected to http://test.host/auth/bookingsync/?account_id= +Filter chain halted as :authenticate_account! rendered or redirected +Completed 302 Found in 0ms (ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1498098722"], ["created_at", "2017-06-21 02:32:02.376181"], ["updated_at", "2017-06-21 02:32:02.376181"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1497925922"], ["created_at", "2017-06-21 02:32:02.379449"], ["updated_at", "2017-06-21 02:32:02.379449"]] +  (0.4ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) BEGIN + Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 5) LIMIT 1 + SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1498185122"], ["updated_at", "2017-06-21 02:32:02.398678"], ["id", 5]] +  (0.5ms) COMMIT +  (0.1ms) ROLLBACK + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 5]] + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" +  (0.1ms) BEGIN + SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 5]] +  (0.3ms) COMMIT +  (0.1ms) BEGIN + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1497925922"], ["created_at", "2017-06-21 02:32:02.407189"], ["updated_at", "2017-06-21 02:32:02.407189"]] +  (0.4ms) COMMIT +  (0.1ms) BEGIN + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 6) LIMIT 1 + SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1498185122"], ["updated_at", "2017-06-21 02:32:02.410322"], ["id", 6]] +  (0.3ms) COMMIT + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" +  (0.1ms) BEGIN + SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 6]] +  (0.3ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2017-06-21 02:32:02.414628"], ["updated_at", "2017-06-21 02:32:02.414628"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.3ms) SELECT COUNT(*) FROM "accounts" + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2017-06-21 02:32:02.419700"], ["updated_at", "2017-06-21 02:32:02.419700"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SELECT COUNT(*) FROM "accounts" +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2017-06-21 02:32:02.422450"], ["updated_at", "2017-06-21 02:32:02.422450"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2017-06-21 02:32:02.425301"], ["updated_at", "2017-06-21 02:32:02.425301"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.0ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2017-06-21 02:32:02.428000"], ["updated_at", "2017-06-21 02:32:02.428000"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2017-06-21 02:32:02.430483"], ["updated_at", "2017-06-21 02:32:02.430483"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2017-06-21 02:32:02.432921"], ["updated_at", "2017-06-21 02:32:02.432921"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2017-06-21 02:32:02.435233"], ["updated_at", "2017-06-21 02:32:02.435233"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2017-06-21 02:32:02.438632"], ["updated_at", "2017-06-21 02:32:02.438632"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2017-06-21 02:32:02.440733"], ["updated_at", "2017-06-21 02:32:02.440733"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 16) LIMIT 1 + SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2017-06-21 02:32:02.443208"], ["id", 16]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2017-06-21 02:32:02.446185"], ["updated_at", "2017-06-21 02:32:02.446185"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2017-06-21 02:32:02.447845"], ["updated_at", "2017-06-21 02:32:02.447845"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 18) LIMIT 1 + SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2017-06-21 02:32:02.449960"], ["id", 18]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 18]] +  (0.1ms) ROLLBACK +  (0.0ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2017-06-21 02:32:02.452997"], ["updated_at", "2017-06-21 02:32:02.452997"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2017-06-21 02:32:02.455244"], ["updated_at", "2017-06-21 02:32:02.455244"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 20) LIMIT 1 + SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2017-06-21 02:32:02.457814"], ["id", 20]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 20]] +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN + Account Load (0.6ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2017-06-21 02:32:02.495645"], ["updated_at", "2017-06-21 02:32:02.495645"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.2ms) UPDATE "accounts" SET "synced_id" = $1, "updated_at" = $2 WHERE "accounts"."id" = $3 [["synced_id", 0], ["updated_at", "2017-06-21 02:32:02.497408"], ["id", 21]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 0 LIMIT 1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["created_at", "2017-06-21 02:32:02.506937"], ["updated_at", "2017-06-21 02:32:02.506937"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 22) LIMIT 1 + SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2017-06-21 02:32:02.508681"], ["id", 22]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 22]] +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as HTML +Redirected to http://test.host/auth/bookingsync/?account_id= +Filter chain halted as :authenticate_account! rendered or redirected +Completed 302 Found in 1ms (ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as HTML + Rendered text template (0.0ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Filter chain halted as :authenticate_account! rendered or redirected +Completed 200 OK in 8ms (Views: 8.0ms | ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as HTML + Parameters: {"xhr"=>true} + Rendered text template (0.0ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Filter chain halted as :authenticate_account! rendered or redirected +Completed 200 OK in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as HTML + Parameters: {"xhr"=>true} +Redirected to http://test.host/auth/bookingsync/?account_id= +Filter chain halted as :authenticate_account! rendered or redirected +Completed 302 Found in 0ms (ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#destroy as HTML +Redirected to http://test.host/ +Completed 302 Found in 0ms (ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#destroy as HTML +Redirected to http://test.host/signed_out +Completed 302 Found in 0ms (ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#create as HTML + Parameters: {"params"=>{"provider"=>"bookingsync"}} + Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] +  (0.2ms) SAVEPOINT active_record_1 + Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.5ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2017-06-21 02:32:31.604312"], ["updated_at", "2017-06-21 02:32:31.604312"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://test.host/admin +Completed 302 Found in 30ms (ActiveRecord: 6.5ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#create as HTML + Parameters: {"params"=>{"provider"=>"bookingsync"}} + Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2017-06-21 02:32:31.614440"], ["updated_at", "2017-06-21 02:32:31.614440"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://test.host/ +Completed 302 Found in 4ms (ActiveRecord: 1.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#create as HTML + Parameters: {"params"=>{"provider"=>"bookingsync"}} + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2017-06-21 02:32:31.622290"], ["updated_at", "2017-06-21 02:32:31.622290"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://test.host/ +Completed 302 Found in 4ms (ActiveRecord: 0.9ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#failure as HTML + Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Completed 200 OK in 11ms (Views: 11.0ms | ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#failure as HTML + Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["created_at", "2017-06-21 02:32:31.648883"], ["updated_at", "2017-06-21 02:32:31.648883"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 4) LIMIT 1 + SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2017-06-21 02:32:31.651805"], ["id", 4]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 4]] +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1497925951"], ["created_at", "2017-06-21 02:32:31.657509"], ["updated_at", "2017-06-21 02:32:31.657509"]] +  (0.4ms) COMMIT +  (0.1ms) BEGIN + Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 5) LIMIT 1 + SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1498185151"], ["updated_at", "2017-06-21 02:32:31.678151"], ["id", 5]] +  (0.4ms) COMMIT + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" +  (0.1ms) BEGIN + SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 5]] +  (0.3ms) COMMIT +  (0.1ms) BEGIN + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1497925951"], ["created_at", "2017-06-21 02:32:31.684044"], ["updated_at", "2017-06-21 02:32:31.684044"]] +  (0.3ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) BEGIN + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 6) LIMIT 1 + SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1498185151"], ["updated_at", "2017-06-21 02:32:31.687768"], ["id", 6]] +  (0.4ms) COMMIT +  (0.1ms) ROLLBACK + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 6]] + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" +  (0.1ms) BEGIN + SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 6]] +  (0.3ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1498098751"], ["created_at", "2017-06-21 02:32:31.694188"], ["updated_at", "2017-06-21 02:32:31.694188"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2017-06-21 02:32:31.697801"], ["updated_at", "2017-06-21 02:32:31.697801"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2017-06-21 02:32:31.700063"], ["updated_at", "2017-06-21 02:32:31.700063"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 9) LIMIT 1 + SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2017-06-21 02:32:31.703209"], ["id", 9]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2017-06-21 02:32:31.706837"], ["updated_at", "2017-06-21 02:32:31.706837"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.4ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2017-06-21 02:32:31.709355"], ["updated_at", "2017-06-21 02:32:31.709355"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 11) LIMIT 1 + SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2017-06-21 02:32:31.713826"], ["id", 11]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 11]] +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2017-06-21 02:32:31.717843"], ["updated_at", "2017-06-21 02:32:31.717843"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2017-06-21 02:32:31.720268"], ["updated_at", "2017-06-21 02:32:31.720268"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 13) LIMIT 1 + SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2017-06-21 02:32:31.723256"], ["id", 13]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 13]] +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2017-06-21 02:32:31.726953"], ["updated_at", "2017-06-21 02:32:31.726953"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.3ms) SELECT COUNT(*) FROM "accounts" + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2017-06-21 02:32:31.732142"], ["updated_at", "2017-06-21 02:32:31.732142"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.2ms) SELECT COUNT(*) FROM "accounts" +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2017-06-21 02:32:31.735846"], ["updated_at", "2017-06-21 02:32:31.735846"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2017-06-21 02:32:31.738447"], ["updated_at", "2017-06-21 02:32:31.738447"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2017-06-21 02:32:31.741728"], ["updated_at", "2017-06-21 02:32:31.741728"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2017-06-21 02:32:31.744954"], ["updated_at", "2017-06-21 02:32:31.744954"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 + SQL (0.3ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2017-06-21 02:32:31.748128"], ["updated_at", "2017-06-21 02:32:31.748128"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2017-06-21 02:32:31.751765"], ["updated_at", "2017-06-21 02:32:31.751765"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN + Account Load (0.5ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2017-06-21 02:32:31.758277"], ["updated_at", "2017-06-21 02:32:31.758277"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.3ms) UPDATE "accounts" SET "synced_id" = $1, "updated_at" = $2 WHERE "accounts"."id" = $3 [["synced_id", 0], ["updated_at", "2017-06-21 02:32:31.760276"], ["id", 22]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 0 LIMIT 1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN + Account Load (1.0ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1 +  (0.2ms) SAVEPOINT active_record_1 + SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2017-06-21 02:34:39.899116"], ["updated_at", "2017-06-21 02:34:39.899116"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.3ms) UPDATE "accounts" SET "synced_id" = $1, "updated_at" = $2 WHERE "accounts"."id" = $3 [["synced_id", 0], ["updated_at", "2017-06-21 02:34:39.901588"], ["id", 1]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 0 LIMIT 1 +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1498098879"], ["created_at", "2017-06-21 02:34:39.921940"], ["updated_at", "2017-06-21 02:34:39.921940"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1497926079"], ["created_at", "2017-06-21 02:34:39.926188"], ["updated_at", "2017-06-21 02:34:39.926188"]] +  (0.4ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) BEGIN + Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 3) LIMIT 1 + SQL (0.3ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1498185279"], ["updated_at", "2017-06-21 02:34:39.954583"], ["id", 3]] +  (0.4ms) COMMIT +  (0.1ms) ROLLBACK + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 3]] + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" +  (0.1ms) BEGIN + SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 3]] +  (0.4ms) COMMIT +  (0.1ms) BEGIN + Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1497926079"], ["created_at", "2017-06-21 02:34:39.963116"], ["updated_at", "2017-06-21 02:34:39.963116"]] +  (0.4ms) COMMIT +  (0.3ms) BEGIN + Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 4) LIMIT 1 + SQL (0.4ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1498185279"], ["updated_at", "2017-06-21 02:34:39.968313"], ["id", 4]] +  (0.4ms) COMMIT + Account Load (0.4ms) SELECT "accounts".* FROM "accounts" +  (0.1ms) BEGIN + SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 4]] +  (0.4ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2017-06-21 02:34:39.974974"], ["updated_at", "2017-06-21 02:34:39.974974"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2017-06-21 02:34:39.977061"], ["updated_at", "2017-06-21 02:34:39.977061"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 6) LIMIT 1 + SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2017-06-21 02:34:39.980437"], ["id", 6]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2017-06-21 02:34:39.985361"], ["updated_at", "2017-06-21 02:34:39.985361"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2017-06-21 02:34:39.987432"], ["updated_at", "2017-06-21 02:34:39.987432"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 8) LIMIT 1 + SQL (0.2ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2017-06-21 02:34:39.990486"], ["id", 8]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 8]] +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2017-06-21 02:34:39.994515"], ["updated_at", "2017-06-21 02:34:39.994515"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 123], ["created_at", "2017-06-21 02:34:39.996396"], ["updated_at", "2017-06-21 02:34:39.996396"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 10) LIMIT 1 + SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2017-06-21 02:34:39.999016"], ["id", 10]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 10]] +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2017-06-21 02:34:40.002814"], ["updated_at", "2017-06-21 02:34:40.002814"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.6ms) SELECT COUNT(*) FROM "accounts" + Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2017-06-21 02:34:40.010048"], ["updated_at", "2017-06-21 02:34:40.010048"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.2ms) SELECT COUNT(*) FROM "accounts" +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2017-06-21 02:34:40.014147"], ["updated_at", "2017-06-21 02:34:40.014147"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2017-06-21 02:34:40.017362"], ["updated_at", "2017-06-21 02:34:40.017362"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2017-06-21 02:34:40.022005"], ["updated_at", "2017-06-21 02:34:40.022005"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2017-06-21 02:34:40.024819"], ["updated_at", "2017-06-21 02:34:40.024819"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("provider", "synced_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["provider", "bookingsync"], ["synced_id", 456], ["created_at", "2017-06-21 02:34:40.027775"], ["updated_at", "2017-06-21 02:34:40.027775"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2017-06-21 02:34:40.030346"], ["updated_at", "2017-06-21 02:34:40.030346"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["created_at", "2017-06-21 02:34:40.033407"], ["updated_at", "2017-06-21 02:34:40.033407"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 19) LIMIT 1 + SQL (0.2ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2017-06-21 02:34:40.035380"], ["id", 19]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 19]] +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#failure as HTML + Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Completed 200 OK in 17ms (Views: 17.3ms | ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#failure as HTML + Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#destroy as HTML +Redirected to http://test.host/ +Completed 302 Found in 0ms (ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#destroy as HTML +Redirected to http://test.host/signed_out +Completed 302 Found in 0ms (ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#create as HTML + Parameters: {"params"=>{"provider"=>"bookingsync"}} + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2017-06-21 02:34:40.127962"], ["updated_at", "2017-06-21 02:34:40.127962"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://test.host/admin +Completed 302 Found in 4ms (ActiveRecord: 0.9ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#create as HTML + Parameters: {"params"=>{"provider"=>"bookingsync"}} + Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.3ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2017-06-21 02:34:40.137202"], ["updated_at", "2017-06-21 02:34:40.137202"]] +  (0.2ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://test.host/ +Completed 302 Found in 5ms (ActiveRecord: 1.5ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#create as HTML + Parameters: {"params"=>{"provider"=>"bookingsync"}} + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1 + SQL (0.2ms) INSERT INTO "accounts" ("synced_id", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["synced_id", 123], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["created_at", "2017-06-21 02:34:40.147022"], ["updated_at", "2017-06-21 02:34:40.147022"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://test.host/ +Completed 302 Found in 4ms (ActiveRecord: 0.9ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as HTML + Parameters: {"xhr"=>true} +Redirected to http://test.host/auth/bookingsync/?account_id= +Filter chain halted as :authenticate_account! rendered or redirected +Completed 302 Found in 0ms (ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as HTML + Parameters: {"xhr"=>true} + Rendered text template (0.0ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Filter chain halted as :authenticate_account! rendered or redirected +Completed 200 OK in 5ms (Views: 4.7ms | ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as HTML + Rendered text template (0.0ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Filter chain halted as :authenticate_account! rendered or redirected +Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as HTML +Redirected to http://test.host/auth/bookingsync/?account_id= +Filter chain halted as :authenticate_account! rendered or redirected +Completed 302 Found in 0ms (ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as HTML +Redirected to http://test.host/auth/bookingsync/?account_id= +Filter chain halted as :authenticate_account! rendered or redirected +Completed 302 Found in 4ms (ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as HTML + Rendering text template + Rendered text template (0.0ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Filter chain halted as :authenticate_account! rendered or redirected +Completed 200 OK in 9ms (Views: 8.5ms | ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as JS + Rendering text template + Rendered text template (0.0ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Filter chain halted as :authenticate_account! rendered or redirected +Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as JS + Rendering text template + Rendered text template (0.0ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Filter chain halted as :authenticate_account! rendered or redirected +Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#create as HTML + Parameters: {"provider"=>"bookingsync"} + Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.2ms) SAVEPOINT active_record_1 + Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", 2017-06-21 02:35:17 UTC], ["updated_at", 2017-06-21 02:35:17 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://test.host/admin +Completed 302 Found in 48ms (ActiveRecord: 11.3ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#create as HTML + Parameters: {"provider"=>"bookingsync"} + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", 2017-06-21 02:35:17 UTC], ["updated_at", 2017-06-21 02:35:17 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://test.host/ +Completed 302 Found in 6ms (ActiveRecord: 1.5ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#create as HTML + Parameters: {"provider"=>"bookingsync"} + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", 2017-06-21 02:35:17 UTC], ["updated_at", 2017-06-21 02:35:17 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://test.host/ +Completed 302 Found in 5ms (ActiveRecord: 1.2ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#failure as HTML + Rendering /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application + Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Completed 200 OK in 11ms (Views: 7.2ms | ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#failure as HTML + Rendering /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application + Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#destroy as HTML +Redirected to http://test.host/signed_out +Completed 302 Found in 0ms (ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#destroy as HTML +Redirected to http://test.host/ +Completed 302 Found in 0ms (ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.0ms) BEGIN +  (0.1ms) ROLLBACK +  (0.0ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.0ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] +  (0.2ms) SAVEPOINT active_record_1 + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", 2017-06-21 02:35:17 UTC], ["updated_at", 2017-06-21 02:35:17 UTC]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", 2017-06-21 02:35:17 UTC], ["synced_id", 0], ["id", 4]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]] +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2017-06-21 02:35:17 UTC], ["updated_at", 2017-06-21 02:35:17 UTC], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2017-06-21 02:35:17 UTC], ["updated_at", 2017-06-21 02:35:17 UTC], ["provider", "bookingsync"], ["synced_id", 123]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 6], ["LIMIT", 1]] + SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2017-06-21 02:35:17 UTC], ["id", 6]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2017-06-21 02:35:17 UTC], ["updated_at", 2017-06-21 02:35:17 UTC], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2017-06-21 02:35:17 UTC], ["updated_at", 2017-06-21 02:35:17 UTC], ["provider", "bookingsync"], ["synced_id", 123]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 8], ["LIMIT", 1]] + SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2017-06-21 02:35:17 UTC], ["id", 8]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 8], ["LIMIT", 1]] +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2017-06-21 02:35:17 UTC], ["updated_at", 2017-06-21 02:35:17 UTC], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.2ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2017-06-21 02:35:17 UTC], ["updated_at", 2017-06-21 02:35:17 UTC], ["provider", "bookingsync"], ["synced_id", 123]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 10], ["LIMIT", 1]] + SQL (0.5ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", 2017-06-21 02:35:17 UTC], ["id", 10]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 10], ["LIMIT", 1]] +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2017-06-21 02:35:17 UTC], ["updated_at", 2017-06-21 02:35:17 UTC], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.3ms) SELECT COUNT(*) FROM "accounts" + Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", 2017-06-21 02:35:17 UTC], ["updated_at", 2017-06-21 02:35:17 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.2ms) SELECT COUNT(*) FROM "accounts" +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2017-06-21 02:35:17 UTC], ["updated_at", 2017-06-21 02:35:17 UTC], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", 2017-06-21 02:35:17 UTC], ["updated_at", 2017-06-21 02:35:17 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2017-06-21 02:35:17 UTC], ["updated_at", 2017-06-21 02:35:17 UTC], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", 2017-06-21 02:35:17 UTC], ["updated_at", 2017-06-21 02:35:17 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", 2017-06-21 02:35:17 UTC], ["updated_at", 2017-06-21 02:35:17 UTC], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", 2017-06-21 02:35:17 UTC], ["updated_at", 2017-06-21 02:35:17 UTC], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN + Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2017-06-21 02:35:17 UTC], ["updated_at", 2017-06-21 02:35:17 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1497926117"]] +  (0.4ms) COMMIT +  (0.1ms) BEGIN + Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 19], ["LIMIT", 1]] + SQL (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2017-06-21 02:35:17 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1498185317"], ["id", 19]] +  (0.5ms) COMMIT + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" +  (0.1ms) BEGIN + SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 19]] +  (0.4ms) COMMIT +  (0.1ms) BEGIN + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2017-06-21 02:35:17 UTC], ["updated_at", 2017-06-21 02:35:17 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1497926117"]] +  (0.4ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) BEGIN + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 20], ["LIMIT", 1]] + SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2017-06-21 02:35:17 UTC], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1498185317"], ["id", 20]] +  (0.3ms) COMMIT +  (0.1ms) ROLLBACK + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 20], ["LIMIT", 1]] + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" +  (0.1ms) BEGIN + SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 20]] +  (0.3ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", 2017-06-21 02:35:17 UTC], ["updated_at", 2017-06-21 02:35:17 UTC], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1498098917"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", 2017-06-21 02:35:17 UTC], ["updated_at", 2017-06-21 02:35:17 UTC], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 22], ["LIMIT", 1]] + SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", 2017-06-21 02:35:17 UTC], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 22]] +  (0.2ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 22], ["LIMIT", 1]] +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.3ms) SAVEPOINT active_record_1 + Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:35:23.565889"], ["updated_at", "2017-06-21 02:35:23.565889"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:35:23.569798"], ["updated_at", "2017-06-21 02:35:23.569798"], ["provider", "bookingsync"], ["synced_id", 123]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 2], ["LIMIT", 1]] + SQL (0.7ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2017-06-21 02:35:23.575532"], ["id", 2]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:35:23.582331"], ["updated_at", "2017-06-21 02:35:23.582331"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:35:23.584294"], ["updated_at", "2017-06-21 02:35:23.584294"], ["provider", "bookingsync"], ["synced_id", 123]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 4], ["LIMIT", 1]] + SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2017-06-21 02:35:23.586904"], ["id", 4]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 4], ["LIMIT", 1]] +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:35:23.591283"], ["updated_at", "2017-06-21 02:35:23.591283"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:35:23.593429"], ["updated_at", "2017-06-21 02:35:23.593429"], ["provider", "bookingsync"], ["synced_id", 123]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.2ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 6], ["LIMIT", 1]] + SQL (0.3ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2017-06-21 02:35:23.597553"], ["id", 6]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 6], ["LIMIT", 1]] +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:35:23.602159"], ["updated_at", "2017-06-21 02:35:23.602159"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.3ms) SELECT COUNT(*) FROM "accounts" + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:35:23.607541"], ["updated_at", "2017-06-21 02:35:23.607541"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.2ms) SELECT COUNT(*) FROM "accounts" +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.2ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:35:23.611813"], ["updated_at", "2017-06-21 02:35:23.611813"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:35:23.614707"], ["updated_at", "2017-06-21 02:35:23.614707"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:35:23.618114"], ["updated_at", "2017-06-21 02:35:23.618114"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:35:23.620725"], ["updated_at", "2017-06-21 02:35:23.620725"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-06-21 02:35:23.623614"], ["updated_at", "2017-06-21 02:35:23.623614"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:35:23.626332"], ["updated_at", "2017-06-21 02:35:23.626332"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] +  (0.2ms) SAVEPOINT active_record_1 + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2017-06-21 02:35:23.634546"], ["updated_at", "2017-06-21 02:35:23.634546"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2017-06-21 02:35:23.636255"], ["synced_id", 0], ["id", 15]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]] +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2017-06-21 02:35:23.687716"], ["updated_at", "2017-06-21 02:35:23.687716"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 16], ["LIMIT", 1]] + SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2017-06-21 02:35:23.689927"], ["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["id", 16]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 16], ["LIMIT", 1]] +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2017-06-21 02:35:23.694187"], ["updated_at", "2017-06-21 02:35:23.694187"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1498098923"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2017-06-21 02:35:23.698527"], ["updated_at", "2017-06-21 02:35:23.698527"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1497926123"]] +  (2.0ms) COMMIT +  (0.1ms) BEGIN + Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 18], ["LIMIT", 1]] + SQL (0.5ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2017-06-21 02:35:23.717151"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1498185323"], ["id", 18]] +  (0.4ms) COMMIT + Account Load (0.4ms) SELECT "accounts".* FROM "accounts" +  (0.1ms) BEGIN + SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 18]] +  (0.4ms) COMMIT +  (0.1ms) BEGIN + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2017-06-21 02:35:23.723697"], ["updated_at", "2017-06-21 02:35:23.723697"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1497926123"]] +  (0.4ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) BEGIN + Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 19], ["LIMIT", 1]] + SQL (0.5ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4 WHERE "accounts"."id" = $5 [["updated_at", "2017-06-21 02:35:23.728672"], ["oauth_access_token", "refreshed_token"], ["oauth_refresh_token", "refreshed_refresh_token"], ["oauth_expires_at", "1498185323"], ["id", 19]] +  (0.5ms) COMMIT +  (0.1ms) ROLLBACK + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 19], ["LIMIT", 1]] + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" +  (0.1ms) BEGIN + SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 19]] +  (0.4ms) COMMIT +  (0.1ms) BEGIN +Processing by SessionsController#destroy as HTML +Redirected to http://test.host/signed_out +Completed 302 Found in 1ms (ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#destroy as HTML +Redirected to http://test.host/ +Completed 302 Found in 0ms (ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#create as HTML + Parameters: {"provider"=>"bookingsync"} + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:35:23.750295"], ["updated_at", "2017-06-21 02:35:23.750295"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://test.host/ +Completed 302 Found in 3ms (ActiveRecord: 0.9ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#create as HTML + Parameters: {"provider"=>"bookingsync"} + Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:35:23.756343"], ["updated_at", "2017-06-21 02:35:23.756343"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://test.host/admin +Completed 302 Found in 4ms (ActiveRecord: 1.1ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#create as HTML + Parameters: {"provider"=>"bookingsync"} + Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.2ms) SAVEPOINT active_record_1 + Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2017-06-21 02:35:23.763723"], ["updated_at", "2017-06-21 02:35:23.763723"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://test.host/ +Completed 302 Found in 5ms (ActiveRecord: 1.1ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#failure as HTML + Rendering /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application + Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Completed 200 OK in 15ms (Views: 11.1ms | ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +Processing by SessionsController#failure as HTML + Rendering /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application + Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as HTML +Redirected to http://test.host/auth/bookingsync/?account_id= +Filter chain halted as :authenticate_account! rendered or redirected +Completed 302 Found in 0ms (ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as HTML + Rendering text template + Rendered text template (0.0ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Filter chain halted as :authenticate_account! rendered or redirected +Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as JS + Rendering text template + Rendered text template (0.0ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Filter chain halted as :authenticate_account! rendered or redirected +Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +Processing by AuthenticatedController#index as JS + Rendering text template + Rendered text template (0.0ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Filter chain halted as :authenticate_account! rendered or redirected +Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK