bookingsync-engine 2.0.2 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 723921aae73287cdedb4271281326c4b87026317
4
- data.tar.gz: b59ffee3a4912315abec696f64337ec240285130
3
+ metadata.gz: 991fd8a5b7f3d06dce726891515ab74d47b3e7ee
4
+ data.tar.gz: a483c8ae6ba71fc8bccf6eef404f197af56f276a
5
5
  SHA512:
6
- metadata.gz: 8da66541deda2e85cca1bfa20accebcac59099f2c0c5898aa7136f808bef85368ec5e1f56aff3c62806c59b80094e84b1e430ae4e55d895511fd7098ad1037b0
7
- data.tar.gz: a117017d87e49e4e8c66ba2dfce630103ee83347233066d33251c722772cb64907b58e11f704e048aac594ec0953201d7e11d749eda646a8d123dad2b88c823f
6
+ metadata.gz: 51e80281200df8b8faede5c09a30e1693d67371c54f84ba394c8e5d7ee34a9fe5e7651f53a678b1e087618d91d584c494609ab991b74f4afd3ebcc91427fc51a
7
+ data.tar.gz: 5ea83f13940d0e710ac84e21b6a20a6a6455fd1458dc8e2b72c2dc43c4bd85b79760b7568d5998a24b3fa45ae1b945e02f316f834cc82dc05838c067efb90683
data/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  ## Requirements
7
7
 
8
- This engine requires Rails `>= 4.2.0` and Ruby `>= 2.2.0`.
8
+ This engine requires Rails `>= 5.0.0` and Ruby `>= 2.2.0`.
9
9
 
10
10
  ## Documentation
11
11
 
@@ -66,7 +66,7 @@ module BookingSync::Engine::AuthHelpers
66
66
  #
67
67
  # Renders the new authorization path with 401 Unauthorized status by default.
68
68
  def request_authorization_for_xhr!
69
- render text: new_authorization_url, status: :unauthorized
69
+ render plain: new_authorization_url, status: :unauthorized
70
70
  end
71
71
 
72
72
  # Request a new authorization for Embedded Apps.
@@ -74,7 +74,7 @@ module BookingSync::Engine::AuthHelpers
74
74
  # Load the new authorization path using Javascript by default.
75
75
  def request_authorization_for_embedded!
76
76
  allow_bookingsync_iframe
77
- render text: "<script type='text/javascript'>top.location.href = " +
77
+ render plain: "<script type='text/javascript'>top.location.href = " +
78
78
  "'#{new_authorization_path}';</script>"
79
79
  end
80
80
 
@@ -1,3 +1,3 @@
1
1
  module BookingSync
2
- ENGINE_VERSION = "2.0.2"
2
+ ENGINE_VERSION = "3.0.0"
3
3
  end
@@ -31,7 +31,7 @@ RSpec.describe AuthenticatedController, type: :controller do
31
31
  before { BookingSync::Engine.embedded! }
32
32
 
33
33
  it "renders the target url in response" do
34
- xhr :get, :index
34
+ get :index, xhr: true
35
35
  expect(response.status).to eq(401)
36
36
  expect(response.body).to eq("http://test.host/auth/bookingsync/?account_id=")
37
37
  end
@@ -41,7 +41,7 @@ RSpec.describe AuthenticatedController, type: :controller do
41
41
  before { BookingSync::Engine.standalone! }
42
42
 
43
43
  it "renders the target url in response" do
44
- xhr :get, :index
44
+ get :index, xhr: true
45
45
  expect(response.status).to eq(401)
46
46
  expect(response.body).to eq("http://test.host/auth/bookingsync/?account_id=")
47
47
  end
@@ -10,17 +10,17 @@ RSpec.describe SessionsController, type: :controller do
10
10
 
11
11
  it "loads or creates account from omniauth auth" do
12
12
  expect(Account).to receive(:from_omniauth).and_call_original
13
- get :create, provider: :bookingsync
13
+ get :create, params: { provider: :bookingsync }
14
14
  end
15
15
 
16
16
  it "runs the account_authorized callback" do
17
17
  expect(controller).to receive(:account_authorized)
18
- get :create, provider: :bookingsync
18
+ get :create, params: { provider: :bookingsync }
19
19
  end
20
20
 
21
21
  it "redirects to after_bookingsync_sign_in_path" do
22
22
  expect(controller).to receive(:after_bookingsync_sign_in_path).and_return("/admin")
23
- get :create, provider: :bookingsync
23
+ get :create, params: { provider: :bookingsync }
24
24
  expect(response).to redirect_to("/admin")
25
25
  end
26
26
  end
@@ -1,5 +1,5 @@
1
1
  class AuthenticatedController < ApplicationController
2
- before_filter :authenticate_account!
2
+ before_action :authenticate_account!
3
3
 
4
4
  def index
5
5
  end
@@ -610,3 +610,218 @@
610
610
   (0.3ms) SELECT version FROM "schema_migrations"
611
611
   (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140522110454')
612
612
   (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140522110326')
613
+  (130.4ms) DROP DATABASE IF EXISTS "bookingsync_engine_test"
614
+  (295.1ms) CREATE DATABASE "bookingsync_engine_test" ENCODING = 'unicode'
615
+  (0.3ms) DROP TABLE IF EXISTS "accounts" CASCADE
616
+  (7.8ms) CREATE TABLE "accounts" ("id" bigserial primary key, "created_at" timestamp, "updated_at" timestamp, "provider" character varying, "synced_id" integer, "name" character varying, "oauth_access_token" character varying, "oauth_refresh_token" character varying, "oauth_expires_at" character varying)
617
+  (1.7ms) CREATE INDEX "index_accounts_on_synced_id" ON "accounts" USING btree ("synced_id")
618
+  (3.1ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)
619
+  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
620
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES (20140522110454)
621
+  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES
622
+ (20140522110326);
623
+
624
+ 
625
+  (3.0ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
626
+ ActiveRecord::InternalMetadata Load (0.3ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
627
+  (0.3ms) BEGIN
628
+ SQL (0.6ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-06-21 02:18:45.043686"], ["updated_at", "2017-06-21 02:18:45.043686"]]
629
+  (0.4ms) COMMIT
630
+ ActiveRecord::InternalMetadata Load (0.3ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
631
+  (0.1ms) BEGIN
632
+  (0.1ms) COMMIT
633
+  (119.4ms) DROP DATABASE IF EXISTS "bookingsync_engine_test"
634
+  (285.2ms) CREATE DATABASE "bookingsync_engine_test" ENCODING = 'unicode'
635
+  (0.3ms) DROP TABLE IF EXISTS "accounts" CASCADE
636
+  (6.7ms) CREATE TABLE "accounts" ("id" bigserial primary key, "created_at" timestamp, "updated_at" timestamp, "provider" character varying, "synced_id" integer, "name" character varying, "oauth_access_token" character varying, "oauth_refresh_token" character varying, "oauth_expires_at" character varying)
637
+  (1.1ms) CREATE INDEX "index_accounts_on_synced_id" ON "accounts" USING btree ("synced_id")
638
+  (3.6ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)
639
+  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
640
+  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES (20140522110454)
641
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES
642
+ (20140522110326);
643
+
644
+ 
645
+  (2.8ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
646
+ ActiveRecord::InternalMetadata Load (0.3ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
647
+  (0.1ms) BEGIN
648
+ SQL (0.4ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-06-21 02:19:34.116066"], ["updated_at", "2017-06-21 02:19:34.116066"]]
649
+  (0.4ms) COMMIT
650
+ ActiveRecord::InternalMetadata Load (0.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
651
+  (0.1ms) BEGIN
652
+  (0.2ms) COMMIT
653
+  (122.0ms) DROP DATABASE IF EXISTS "bookingsync_engine_test"
654
+  (242.2ms) CREATE DATABASE "bookingsync_engine_test" ENCODING = 'unicode'
655
+  (0.3ms) DROP TABLE IF EXISTS "accounts" CASCADE
656
+  (8.4ms) CREATE TABLE "accounts" ("id" bigserial primary key, "created_at" timestamp, "updated_at" timestamp, "provider" character varying, "synced_id" integer, "name" character varying, "oauth_access_token" character varying, "oauth_refresh_token" character varying, "oauth_expires_at" character varying)
657
+  (1.8ms) CREATE INDEX "index_accounts_on_synced_id" ON "accounts" USING btree ("synced_id")
658
+  (4.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)
659
+  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
660
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES (20140522110454)
661
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES
662
+ (20140522110326);
663
+
664
+ 
665
+  (3.5ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
666
+ ActiveRecord::InternalMetadata Load (0.4ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
667
+  (0.2ms) BEGIN
668
+ SQL (0.5ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-06-21 02:20:05.523495"], ["updated_at", "2017-06-21 02:20:05.523495"]]
669
+  (0.4ms) COMMIT
670
+ ActiveRecord::InternalMetadata Load (0.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
671
+  (0.1ms) BEGIN
672
+  (0.2ms) COMMIT
673
+  (118.6ms) DROP DATABASE IF EXISTS "bookingsync_engine_test"
674
+  (238.7ms) CREATE DATABASE "bookingsync_engine_test" ENCODING = 'unicode'
675
+  (0.2ms) DROP TABLE IF EXISTS "accounts" CASCADE
676
+  (6.7ms) CREATE TABLE "accounts" ("id" bigserial primary key, "created_at" timestamp, "updated_at" timestamp, "provider" character varying, "synced_id" integer, "name" character varying, "oauth_access_token" character varying, "oauth_refresh_token" character varying, "oauth_expires_at" character varying)
677
+  (1.3ms) CREATE INDEX "index_accounts_on_synced_id" ON "accounts" USING btree ("synced_id")
678
+  (5.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)
679
+  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
680
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES (20140522110454)
681
+  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES
682
+ (20140522110326);
683
+
684
+ 
685
+  (3.3ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
686
+ ActiveRecord::InternalMetadata Load (0.3ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
687
+  (0.2ms) BEGIN
688
+ SQL (0.5ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-06-21 02:20:17.627845"], ["updated_at", "2017-06-21 02:20:17.627845"]]
689
+  (0.4ms) COMMIT
690
+ ActiveRecord::InternalMetadata Load (0.3ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
691
+  (0.1ms) BEGIN
692
+  (0.1ms) COMMIT
693
+  (119.5ms) DROP DATABASE IF EXISTS "bookingsync_engine_test"
694
+  (239.0ms) CREATE DATABASE "bookingsync_engine_test" ENCODING = 'unicode'
695
+  (0.3ms) DROP TABLE IF EXISTS "accounts" CASCADE
696
+  (7.4ms) CREATE TABLE "accounts" ("id" bigserial primary key, "created_at" timestamp, "updated_at" timestamp, "provider" character varying, "synced_id" integer, "name" character varying, "oauth_access_token" character varying, "oauth_refresh_token" character varying, "oauth_expires_at" character varying)
697
+  (1.4ms) CREATE INDEX "index_accounts_on_synced_id" ON "accounts" USING btree ("synced_id")
698
+  (3.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)
699
+  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
700
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES (20140522110454)
701
+  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES
702
+ (20140522110326);
703
+
704
+ 
705
+  (3.4ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
706
+ ActiveRecord::InternalMetadata Load (0.3ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
707
+  (0.1ms) BEGIN
708
+ SQL (0.4ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-06-21 02:23:15.045003"], ["updated_at", "2017-06-21 02:23:15.045003"]]
709
+  (0.4ms) COMMIT
710
+ ActiveRecord::InternalMetadata Load (0.3ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
711
+  (0.1ms) BEGIN
712
+  (0.1ms) COMMIT
713
+  (138.2ms) DROP DATABASE IF EXISTS "bookingsync_engine_test"
714
+  (259.0ms) CREATE DATABASE "bookingsync_engine_test" ENCODING = 'unicode'
715
+  (0.3ms) DROP TABLE IF EXISTS "accounts" CASCADE
716
+  (13.0ms) CREATE TABLE "accounts" ("id" bigserial primary key, "created_at" timestamp, "updated_at" timestamp, "provider" character varying, "synced_id" integer, "name" character varying, "oauth_access_token" character varying, "oauth_refresh_token" character varying, "oauth_expires_at" character varying)
717
+  (1.4ms) CREATE INDEX "index_accounts_on_synced_id" ON "accounts" USING btree ("synced_id")
718
+  (4.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)
719
+  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
720
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES (20140522110454)
721
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES
722
+ (20140522110326);
723
+
724
+ 
725
+  (4.0ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
726
+ ActiveRecord::InternalMetadata Load (0.4ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
727
+  (0.2ms) BEGIN
728
+ SQL (0.5ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-06-21 02:27:20.709613"], ["updated_at", "2017-06-21 02:27:20.709613"]]
729
+  (0.5ms) COMMIT
730
+ ActiveRecord::InternalMetadata Load (0.4ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
731
+  (0.3ms) BEGIN
732
+  (0.2ms) COMMIT
733
+  (119.6ms) DROP DATABASE IF EXISTS "bookingsync_engine_test"
734
+  (237.3ms) CREATE DATABASE "bookingsync_engine_test" ENCODING = 'unicode'
735
+  (0.4ms) DROP TABLE IF EXISTS "accounts" CASCADE
736
+  (7.6ms) CREATE TABLE "accounts" ("id" bigserial primary key, "created_at" timestamp, "updated_at" timestamp, "provider" character varying, "synced_id" integer, "name" character varying, "oauth_access_token" character varying, "oauth_refresh_token" character varying, "oauth_expires_at" character varying)
737
+  (1.5ms) CREATE INDEX "index_accounts_on_synced_id" ON "accounts" USING btree ("synced_id")
738
+  (3.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)
739
+  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
740
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES (20140522110454)
741
+  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES
742
+ (20140522110326);
743
+
744
+ 
745
+  (3.2ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
746
+ ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
747
+  (0.1ms) BEGIN
748
+ SQL (0.4ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-06-21 02:27:28.290500"], ["updated_at", "2017-06-21 02:27:28.290500"]]
749
+  (0.5ms) COMMIT
750
+ ActiveRecord::InternalMetadata Load (0.3ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
751
+  (0.1ms) BEGIN
752
+  (0.1ms) COMMIT
753
+  (122.3ms) DROP DATABASE IF EXISTS "bookingsync_engine_test"
754
+  (292.9ms) CREATE DATABASE "bookingsync_engine_test" ENCODING = 'unicode'
755
+  (7.4ms) CREATE TABLE "accounts" ("id" serial primary key, "created_at" timestamp, "updated_at" timestamp, "provider" character varying, "synced_id" integer, "name" character varying, "oauth_access_token" character varying, "oauth_refresh_token" character varying, "oauth_expires_at" character varying) 
756
+  (1.2ms) CREATE INDEX "index_accounts_on_synced_id" ON "accounts" USING btree ("synced_id")
757
+  (2.6ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
758
+  (1.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
759
+  (0.3ms) SELECT version FROM "schema_migrations"
760
+  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140522110454')
761
+  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140522110326')
762
+  (118.5ms) DROP DATABASE IF EXISTS "bookingsync_engine_test"
763
+  (242.3ms) CREATE DATABASE "bookingsync_engine_test" ENCODING = 'unicode'
764
+  (6.8ms) CREATE TABLE "accounts" ("id" serial primary key, "created_at" timestamp, "updated_at" timestamp, "provider" character varying, "synced_id" integer, "name" character varying, "oauth_access_token" character varying, "oauth_refresh_token" character varying, "oauth_expires_at" character varying) 
765
+  (1.3ms) CREATE INDEX "index_accounts_on_synced_id" ON "accounts" USING btree ("synced_id")
766
+  (2.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
767
+  (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
768
+  (0.4ms) SELECT version FROM "schema_migrations"
769
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140522110454')
770
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140522110326')
771
+  (120.8ms) DROP DATABASE IF EXISTS "bookingsync_engine_test"
772
+  (236.0ms) CREATE DATABASE "bookingsync_engine_test" ENCODING = 'unicode'
773
+  (6.8ms) CREATE TABLE "accounts" ("id" serial primary key, "created_at" timestamp, "updated_at" timestamp, "provider" character varying, "synced_id" integer, "name" character varying, "oauth_access_token" character varying, "oauth_refresh_token" character varying, "oauth_expires_at" character varying) 
774
+  (1.2ms) CREATE INDEX "index_accounts_on_synced_id" ON "accounts" USING btree ("synced_id")
775
+  (2.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
776
+  (1.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
777
+  (0.4ms) SELECT version FROM "schema_migrations"
778
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140522110454')
779
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140522110326')
780
+  (118.8ms) DROP DATABASE IF EXISTS "bookingsync_engine_test"
781
+  (243.1ms) CREATE DATABASE "bookingsync_engine_test" ENCODING = 'unicode'
782
+  (6.8ms) CREATE TABLE "accounts" ("id" serial primary key, "created_at" timestamp, "updated_at" timestamp, "provider" character varying, "synced_id" integer, "name" character varying, "oauth_access_token" character varying, "oauth_refresh_token" character varying, "oauth_expires_at" character varying) 
783
+  (1.2ms) CREATE INDEX "index_accounts_on_synced_id" ON "accounts" USING btree ("synced_id")
784
+  (2.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
785
+  (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
786
+  (0.4ms) SELECT version FROM "schema_migrations"
787
+  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140522110454')
788
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140522110326')
789
+  (123.3ms) DROP DATABASE IF EXISTS "bookingsync_engine_test"
790
+  (246.0ms) CREATE DATABASE "bookingsync_engine_test" ENCODING = 'unicode'
791
+  (5.7ms) CREATE TABLE "accounts" ("id" serial primary key, "created_at" timestamp, "updated_at" timestamp, "provider" character varying, "synced_id" integer, "name" character varying, "oauth_access_token" character varying, "oauth_refresh_token" character varying, "oauth_expires_at" character varying)
792
+  (1.1ms) CREATE INDEX "index_accounts_on_synced_id" ON "accounts" USING btree ("synced_id")
793
+  (3.0ms) CREATE TABLE "schema_migrations" ("version" character varying PRIMARY KEY)
794
+  (0.3ms) SELECT version FROM "schema_migrations"
795
+  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140522110454')
796
+  (0.5ms) INSERT INTO schema_migrations (version) VALUES
797
+ ('20140522110326');
798
+
799
+ 
800
+  (2.8ms) CREATE TABLE "ar_internal_metadata" ("key" character varying PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
801
+ ActiveRecord::InternalMetadata Load (0.4ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", :environment], ["LIMIT", 1]]
802
+  (0.1ms) BEGIN
803
+ SQL (0.3ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", 2017-06-21 02:35:14 UTC], ["updated_at", 2017-06-21 02:35:14 UTC]]
804
+  (0.3ms) COMMIT
805
+ ActiveRecord::InternalMetadata Load (0.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", :environment], ["LIMIT", 1]]
806
+  (0.1ms) BEGIN
807
+  (0.1ms) COMMIT
808
+  (120.2ms) DROP DATABASE IF EXISTS "bookingsync_engine_test"
809
+  (235.9ms) CREATE DATABASE "bookingsync_engine_test" ENCODING = 'unicode'
810
+  (0.2ms) DROP TABLE IF EXISTS "accounts" CASCADE
811
+  (7.0ms) CREATE TABLE "accounts" ("id" bigserial primary key, "created_at" timestamp, "updated_at" timestamp, "provider" character varying, "synced_id" integer, "name" character varying, "oauth_access_token" character varying, "oauth_refresh_token" character varying, "oauth_expires_at" character varying)
812
+  (1.3ms) CREATE INDEX "index_accounts_on_synced_id" ON "accounts" USING btree ("synced_id")
813
+  (2.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)
814
+  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
815
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES (20140522110454)
816
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES
817
+ (20140522110326);
818
+
819
+ 
820
+  (3.1ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
821
+ ActiveRecord::InternalMetadata Load (0.3ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
822
+  (0.1ms) BEGIN
823
+ SQL (0.3ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-06-21 02:35:21.438670"], ["updated_at", "2017-06-21 02:35:21.438670"]]
824
+  (0.3ms) COMMIT
825
+ ActiveRecord::InternalMetadata Load (0.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
826
+  (0.1ms) BEGIN
827
+  (0.1ms) COMMIT
@@ -10074,3 +10074,2850 @@ Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)
10074
10074
   (0.1ms) ROLLBACK
10075
10075
   (0.0ms) BEGIN
10076
10076
   (0.0ms) ROLLBACK
10077
+  (0.1ms) BEGIN
10078
+  (0.4ms) ROLLBACK
10079
+  (0.1ms) BEGIN
10080
+  (0.1ms) ROLLBACK
10081
+  (0.1ms) BEGIN
10082
+ Processing by AuthenticatedController#index as HTML
10083
+ Completed 500 Internal Server Error in 92ms (ActiveRecord: 0.0ms)
10084
+  (0.3ms) ROLLBACK
10085
+  (0.1ms) BEGIN
10086
+ Processing by AuthenticatedController#index as HTML
10087
+ Redirected to http://test.host/auth/bookingsync/?account_id=
10088
+ Filter chain halted as :authenticate_account! rendered or redirected
10089
+ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
10090
+  (0.2ms) ROLLBACK
10091
+  (0.1ms) BEGIN
10092
+ Processing by SessionsController#failure as HTML
10093
+ Rendering /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application
10094
+ Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms)
10095
+ Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
10096
+ Completed 200 OK in 20ms (Views: 15.1ms | ActiveRecord: 0.0ms)
10097
+  (0.3ms) ROLLBACK
10098
+  (0.1ms) BEGIN
10099
+ Processing by SessionsController#failure as HTML
10100
+ Rendering /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application
10101
+ Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms)
10102
+ Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
10103
+ Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)
10104
+  (0.2ms) ROLLBACK
10105
+  (0.2ms) BEGIN
10106
+  (0.2ms) ROLLBACK
10107
+  (0.1ms) BEGIN
10108
+  (0.1ms) ROLLBACK
10109
+  (0.1ms) BEGIN
10110
+  (0.2ms) ROLLBACK
10111
+  (0.1ms) BEGIN
10112
+ Processing by SessionsController#destroy as HTML
10113
+ Redirected to http://test.host/
10114
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
10115
+  (0.2ms) ROLLBACK
10116
+  (0.1ms) BEGIN
10117
+ Processing by SessionsController#destroy as HTML
10118
+ Redirected to http://test.host/signed_out
10119
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
10120
+  (0.1ms) ROLLBACK
10121
+  (0.1ms) BEGIN
10122
+ Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]
10123
+  (0.1ms) SAVEPOINT active_record_1
10124
+ 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"]]
10125
+  (0.2ms) RELEASE SAVEPOINT active_record_1
10126
+  (0.1ms) SAVEPOINT active_record_1
10127
+ 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]]
10128
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10129
+ Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]
10130
+  (0.1ms) ROLLBACK
10131
+  (0.1ms) BEGIN
10132
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10133
+ 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"]]
10134
+  (0.7ms) COMMIT
10135
+  (0.2ms) BEGIN
10136
+ 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]]
10137
+ 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]]
10138
+  (0.6ms) COMMIT
10139
+ Account Load (0.4ms) SELECT "accounts".* FROM "accounts"
10140
+  (0.1ms) BEGIN
10141
+ SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 2]]
10142
+  (0.4ms) COMMIT
10143
+  (0.1ms) BEGIN
10144
+ Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10145
+ 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"]]
10146
+  (0.4ms) COMMIT
10147
+  (0.1ms) BEGIN
10148
+  (0.1ms) BEGIN
10149
+ 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]]
10150
+ 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]]
10151
+  (0.4ms) COMMIT
10152
+  (0.1ms) ROLLBACK
10153
+ Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 3], ["LIMIT", 1]]
10154
+ Account Load (0.3ms) SELECT "accounts".* FROM "accounts"
10155
+  (0.1ms) BEGIN
10156
+ SQL (0.4ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 3]]
10157
+  (0.4ms) COMMIT
10158
+  (0.1ms) BEGIN
10159
+  (0.1ms) SAVEPOINT active_record_1
10160
+ Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10161
+ 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"]]
10162
+  (0.2ms) RELEASE SAVEPOINT active_record_1
10163
+  (0.4ms) ROLLBACK
10164
+  (0.1ms) BEGIN
10165
+  (0.1ms) SAVEPOINT active_record_1
10166
+ Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
10167
+ 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]]
10168
+  (0.2ms) RELEASE SAVEPOINT active_record_1
10169
+  (0.1ms) SAVEPOINT active_record_1
10170
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10171
+ 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]]
10172
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10173
+ 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]]
10174
+  (0.1ms) SAVEPOINT active_record_1
10175
+ 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]]
10176
+ 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]]
10177
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10178
+  (0.1ms) ROLLBACK
10179
+  (0.1ms) BEGIN
10180
+  (0.1ms) SAVEPOINT active_record_1
10181
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
10182
+ 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]]
10183
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10184
+  (0.1ms) SAVEPOINT active_record_1
10185
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10186
+ 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]]
10187
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10188
+ 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]]
10189
+  (0.1ms) SAVEPOINT active_record_1
10190
+ 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]]
10191
+ 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]]
10192
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10193
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 8], ["LIMIT", 1]]
10194
+  (0.2ms) ROLLBACK
10195
+  (0.1ms) BEGIN
10196
+  (0.1ms) SAVEPOINT active_record_1
10197
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
10198
+ 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]]
10199
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10200
+  (0.1ms) SAVEPOINT active_record_1
10201
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10202
+ 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]]
10203
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10204
+ 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]]
10205
+  (0.1ms) SAVEPOINT active_record_1
10206
+ 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]]
10207
+ 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]]
10208
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10209
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 10], ["LIMIT", 1]]
10210
+  (0.1ms) ROLLBACK
10211
+  (0.1ms) BEGIN
10212
+  (0.1ms) SAVEPOINT active_record_1
10213
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
10214
+ 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]]
10215
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10216
+  (0.4ms) SELECT COUNT(*) FROM "accounts"
10217
+ 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]]
10218
+  (0.1ms) SAVEPOINT active_record_1
10219
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10220
+ 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"]]
10221
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10222
+  (0.2ms) SELECT COUNT(*) FROM "accounts"
10223
+  (0.1ms) ROLLBACK
10224
+  (0.1ms) BEGIN
10225
+  (0.1ms) SAVEPOINT active_record_1
10226
+ Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
10227
+ 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]]
10228
+  (0.2ms) RELEASE SAVEPOINT active_record_1
10229
+ 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]]
10230
+  (0.1ms) SAVEPOINT active_record_1
10231
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10232
+ 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"]]
10233
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10234
+  (0.1ms) ROLLBACK
10235
+  (0.1ms) BEGIN
10236
+  (0.1ms) SAVEPOINT active_record_1
10237
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
10238
+ 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]]
10239
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10240
+ 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]]
10241
+  (0.1ms) SAVEPOINT active_record_1
10242
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10243
+ 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"]]
10244
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10245
+  (0.1ms) ROLLBACK
10246
+  (0.1ms) BEGIN
10247
+  (0.1ms) SAVEPOINT active_record_1
10248
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
10249
+ 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]]
10250
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10251
+ 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]]
10252
+  (0.1ms) SAVEPOINT active_record_1
10253
+ Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10254
+ 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"]]
10255
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10256
+  (0.1ms) ROLLBACK
10257
+  (0.1ms) BEGIN
10258
+  (0.2ms) ROLLBACK
10259
+  (0.1ms) BEGIN
10260
+  (0.1ms) SAVEPOINT active_record_1
10261
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]]
10262
+ 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"]]
10263
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10264
+  (0.1ms) SAVEPOINT active_record_1
10265
+ 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]]
10266
+ 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]]
10267
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10268
+ Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 19], ["LIMIT", 1]]
10269
+  (0.2ms) ROLLBACK
10270
+  (0.1ms) BEGIN
10271
+  (0.1ms) ROLLBACK
10272
+  (0.1ms) BEGIN
10273
+  (0.1ms) ROLLBACK
10274
+  (0.1ms) BEGIN
10275
+  (0.1ms) ROLLBACK
10276
+  (0.1ms) BEGIN
10277
+  (0.1ms) ROLLBACK
10278
+  (0.1ms) BEGIN
10279
+  (0.1ms) ROLLBACK
10280
+  (0.1ms) BEGIN
10281
+  (0.2ms) ROLLBACK
10282
+  (0.1ms) BEGIN
10283
+  (0.1ms) ROLLBACK
10284
+  (0.1ms) BEGIN
10285
+ Processing by AuthenticatedController#index as HTML
10286
+ Completed 500 Internal Server Error in 84ms (ActiveRecord: 0.0ms)
10287
+  (0.1ms) ROLLBACK
10288
+  (0.1ms) BEGIN
10289
+ Processing by AuthenticatedController#index as HTML
10290
+ Redirected to http://test.host/auth/bookingsync/?account_id=
10291
+ Filter chain halted as :authenticate_account! rendered or redirected
10292
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
10293
+  (0.2ms) ROLLBACK
10294
+  (0.1ms) BEGIN
10295
+  (0.1ms) ROLLBACK
10296
+  (0.1ms) BEGIN
10297
+  (0.1ms) ROLLBACK
10298
+  (0.1ms) BEGIN
10299
+  (0.1ms) ROLLBACK
10300
+  (0.1ms) BEGIN
10301
+  (0.1ms) ROLLBACK
10302
+  (0.1ms) BEGIN
10303
+  (0.1ms) ROLLBACK
10304
+  (0.1ms) BEGIN
10305
+  (0.2ms) ROLLBACK
10306
+  (0.1ms) BEGIN
10307
+  (0.1ms) SAVEPOINT active_record_1
10308
+ Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
10309
+ 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]]
10310
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10311
+  (0.1ms) SAVEPOINT active_record_1
10312
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10313
+ 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]]
10314
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10315
+ 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]]
10316
+  (0.1ms) SAVEPOINT active_record_1
10317
+ 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]]
10318
+ 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]]
10319
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10320
+  (0.2ms) ROLLBACK
10321
+  (0.1ms) BEGIN
10322
+  (0.1ms) SAVEPOINT active_record_1
10323
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
10324
+ 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]]
10325
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10326
+  (0.1ms) SAVEPOINT active_record_1
10327
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10328
+ 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]]
10329
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10330
+ 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]]
10331
+  (0.1ms) SAVEPOINT active_record_1
10332
+ 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]]
10333
+ 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]]
10334
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10335
+ Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 4], ["LIMIT", 1]]
10336
+  (0.1ms) ROLLBACK
10337
+  (0.1ms) BEGIN
10338
+  (0.1ms) SAVEPOINT active_record_1
10339
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
10340
+ 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]]
10341
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10342
+  (0.1ms) SAVEPOINT active_record_1
10343
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10344
+ 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]]
10345
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10346
+ 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]]
10347
+  (0.1ms) SAVEPOINT active_record_1
10348
+ 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]]
10349
+ 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]]
10350
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10351
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 6], ["LIMIT", 1]]
10352
+  (0.1ms) ROLLBACK
10353
+  (0.1ms) BEGIN
10354
+  (0.1ms) SAVEPOINT active_record_1
10355
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
10356
+ 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]]
10357
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10358
+  (0.4ms) SELECT COUNT(*) FROM "accounts"
10359
+ 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]]
10360
+  (0.1ms) SAVEPOINT active_record_1
10361
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10362
+ 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"]]
10363
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10364
+  (0.3ms) SELECT COUNT(*) FROM "accounts"
10365
+  (0.2ms) ROLLBACK
10366
+  (0.1ms) BEGIN
10367
+  (0.1ms) SAVEPOINT active_record_1
10368
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
10369
+ 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]]
10370
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10371
+ 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]]
10372
+  (0.1ms) SAVEPOINT active_record_1
10373
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10374
+ 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"]]
10375
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10376
+  (0.1ms) ROLLBACK
10377
+  (0.1ms) BEGIN
10378
+  (0.1ms) SAVEPOINT active_record_1
10379
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
10380
+ 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]]
10381
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10382
+ 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]]
10383
+  (0.1ms) SAVEPOINT active_record_1
10384
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10385
+ 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"]]
10386
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10387
+  (0.1ms) ROLLBACK
10388
+  (0.1ms) BEGIN
10389
+  (0.1ms) SAVEPOINT active_record_1
10390
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
10391
+ 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]]
10392
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10393
+ 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]]
10394
+  (0.1ms) SAVEPOINT active_record_1
10395
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10396
+ 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"]]
10397
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10398
+  (0.1ms) ROLLBACK
10399
+  (0.1ms) BEGIN
10400
+  (0.1ms) SAVEPOINT active_record_1
10401
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]]
10402
+ 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"]]
10403
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10404
+  (0.1ms) SAVEPOINT active_record_1
10405
+ 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]]
10406
+ 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]]
10407
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10408
+ Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 15], ["LIMIT", 1]]
10409
+  (0.2ms) ROLLBACK
10410
+  (0.1ms) BEGIN
10411
+ Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]
10412
+  (0.1ms) SAVEPOINT active_record_1
10413
+ 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"]]
10414
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10415
+  (0.1ms) SAVEPOINT active_record_1
10416
+ 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]]
10417
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10418
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]
10419
+  (0.1ms) ROLLBACK
10420
+  (0.1ms) BEGIN
10421
+  (0.1ms) SAVEPOINT active_record_1
10422
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10423
+ 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"]]
10424
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10425
+  (0.1ms) ROLLBACK
10426
+  (0.1ms) BEGIN
10427
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10428
+ 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"]]
10429
+  (0.5ms) COMMIT
10430
+  (0.1ms) BEGIN
10431
+  (0.1ms) BEGIN
10432
+ 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]]
10433
+ 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]]
10434
+  (0.5ms) COMMIT
10435
+  (0.1ms) ROLLBACK
10436
+ Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 18], ["LIMIT", 1]]
10437
+ Account Load (0.3ms) SELECT "accounts".* FROM "accounts"
10438
+  (0.1ms) BEGIN
10439
+ SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 18]]
10440
+  (0.4ms) COMMIT
10441
+  (0.1ms) BEGIN
10442
+ Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10443
+ 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"]]
10444
+  (0.4ms) COMMIT
10445
+  (0.1ms) BEGIN
10446
+ 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]]
10447
+ 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]]
10448
+  (0.4ms) COMMIT
10449
+ Account Load (0.3ms) SELECT "accounts".* FROM "accounts"
10450
+  (0.1ms) BEGIN
10451
+ SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 19]]
10452
+  (0.3ms) COMMIT
10453
+  (0.1ms) BEGIN
10454
+ Processing by SessionsController#destroy as HTML
10455
+ Redirected to http://test.host/
10456
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
10457
+  (0.1ms) ROLLBACK
10458
+  (0.1ms) BEGIN
10459
+ Processing by SessionsController#destroy as HTML
10460
+ Redirected to http://test.host/signed_out
10461
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
10462
+  (0.1ms) ROLLBACK
10463
+  (0.2ms) BEGIN
10464
+  (0.1ms) ROLLBACK
10465
+  (0.1ms) BEGIN
10466
+  (0.2ms) ROLLBACK
10467
+  (0.2ms) BEGIN
10468
+ Processing by SessionsController#create as HTML
10469
+ Parameters: {"provider"=>"bookingsync"}
10470
+ 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]]
10471
+  (0.1ms) SAVEPOINT active_record_1
10472
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10473
+ 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"]]
10474
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10475
+ Redirected to http://test.host/
10476
+ Completed 302 Found in 4ms (ActiveRecord: 1.0ms)
10477
+  (0.2ms) ROLLBACK
10478
+  (0.1ms) BEGIN
10479
+ Processing by SessionsController#failure as HTML
10480
+ Rendering /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application
10481
+ Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms)
10482
+ Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
10483
+ Completed 200 OK in 12ms (Views: 7.8ms | ActiveRecord: 0.0ms)
10484
+  (0.2ms) ROLLBACK
10485
+  (0.1ms) BEGIN
10486
+ Processing by SessionsController#failure as HTML
10487
+ Rendering /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application
10488
+ Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms)
10489
+ Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
10490
+ Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)
10491
+  (0.1ms) ROLLBACK
10492
+  (0.1ms) BEGIN
10493
+  (0.2ms) ROLLBACK
10494
+  (0.1ms) BEGIN
10495
+  (0.2ms) ROLLBACK
10496
+  (0.1ms) BEGIN
10497
+  (0.1ms) ROLLBACK
10498
+  (0.1ms) BEGIN
10499
+  (0.1ms) ROLLBACK
10500
+  (0.1ms) BEGIN
10501
+  (0.1ms) ROLLBACK
10502
+  (0.1ms) BEGIN
10503
+  (0.1ms) ROLLBACK
10504
+  (0.2ms) BEGIN
10505
+  (0.2ms) ROLLBACK
10506
+  (0.2ms) BEGIN
10507
+ Processing by AuthenticatedController#index as HTML
10508
+ Completed 500 Internal Server Error in 82ms (ActiveRecord: 0.0ms)
10509
+  (0.1ms) ROLLBACK
10510
+  (0.1ms) BEGIN
10511
+ Processing by AuthenticatedController#index as HTML
10512
+ Redirected to http://test.host/auth/bookingsync/?account_id=
10513
+ Filter chain halted as :authenticate_account! rendered or redirected
10514
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
10515
+  (0.2ms) ROLLBACK
10516
+  (0.1ms) BEGIN
10517
+ Processing by SessionsController#failure as HTML
10518
+ Rendering /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application
10519
+ Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms)
10520
+ Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
10521
+ Completed 200 OK in 13ms (Views: 7.7ms | ActiveRecord: 0.0ms)
10522
+  (0.2ms) ROLLBACK
10523
+  (0.1ms) BEGIN
10524
+ Processing by SessionsController#failure as HTML
10525
+ Rendering /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application
10526
+ Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms)
10527
+ Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
10528
+ Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)
10529
+  (0.1ms) ROLLBACK
10530
+  (0.1ms) BEGIN
10531
+ Processing by SessionsController#destroy as HTML
10532
+ Redirected to http://test.host/signed_out
10533
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
10534
+  (0.1ms) ROLLBACK
10535
+  (0.1ms) BEGIN
10536
+ Processing by SessionsController#destroy as HTML
10537
+ Redirected to http://test.host/
10538
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
10539
+  (0.1ms) ROLLBACK
10540
+  (0.1ms) BEGIN
10541
+ Processing by SessionsController#create as HTML
10542
+ Parameters: {"provider"=>"bookingsync"}
10543
+ 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]]
10544
+  (0.2ms) SAVEPOINT active_record_1
10545
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10546
+ 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"]]
10547
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10548
+ Redirected to http://test.host/
10549
+ Completed 302 Found in 27ms (ActiveRecord: 7.7ms)
10550
+  (0.1ms) ROLLBACK
10551
+  (0.1ms) BEGIN
10552
+ Processing by SessionsController#create as HTML
10553
+ Parameters: {"provider"=>"bookingsync"}
10554
+ 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]]
10555
+  (0.1ms) SAVEPOINT active_record_1
10556
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10557
+ 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"]]
10558
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10559
+ Redirected to http://test.host/admin
10560
+ Completed 302 Found in 4ms (ActiveRecord: 1.0ms)
10561
+  (0.1ms) ROLLBACK
10562
+  (0.1ms) BEGIN
10563
+ Processing by SessionsController#create as HTML
10564
+ Parameters: {"provider"=>"bookingsync"}
10565
+ 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]]
10566
+  (0.1ms) SAVEPOINT active_record_1
10567
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10568
+ 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"]]
10569
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10570
+ Redirected to http://test.host/
10571
+ Completed 302 Found in 3ms (ActiveRecord: 0.9ms)
10572
+  (0.1ms) ROLLBACK
10573
+  (0.1ms) BEGIN
10574
+  (0.1ms) ROLLBACK
10575
+  (0.1ms) BEGIN
10576
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10577
+ 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"]]
10578
+  (0.4ms) COMMIT
10579
+  (0.1ms) BEGIN
10580
+  (0.1ms) BEGIN
10581
+ 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]]
10582
+ 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]]
10583
+  (0.4ms) COMMIT
10584
+  (0.1ms) ROLLBACK
10585
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 4], ["LIMIT", 1]]
10586
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts"
10587
+  (0.1ms) BEGIN
10588
+ SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 4]]
10589
+  (0.3ms) COMMIT
10590
+  (0.1ms) BEGIN
10591
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10592
+ 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"]]
10593
+  (0.5ms) COMMIT
10594
+  (0.1ms) BEGIN
10595
+ 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]]
10596
+ 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]]
10597
+  (0.4ms) COMMIT
10598
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts"
10599
+  (0.1ms) BEGIN
10600
+ SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 5]]
10601
+  (0.3ms) COMMIT
10602
+  (0.1ms) BEGIN
10603
+  (0.1ms) SAVEPOINT active_record_1
10604
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10605
+ 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"]]
10606
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10607
+  (0.1ms) ROLLBACK
10608
+  (0.1ms) BEGIN
10609
+  (0.1ms) SAVEPOINT active_record_1
10610
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
10611
+ 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]]
10612
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10613
+  (0.3ms) SELECT COUNT(*) FROM "accounts"
10614
+ 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]]
10615
+  (0.1ms) SAVEPOINT active_record_1
10616
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10617
+ 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"]]
10618
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10619
+  (0.2ms) SELECT COUNT(*) FROM "accounts"
10620
+  (0.1ms) ROLLBACK
10621
+  (0.1ms) BEGIN
10622
+  (0.1ms) SAVEPOINT active_record_1
10623
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
10624
+ 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]]
10625
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10626
+ 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]]
10627
+  (0.1ms) SAVEPOINT active_record_1
10628
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10629
+ 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"]]
10630
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10631
+  (0.1ms) ROLLBACK
10632
+  (0.1ms) BEGIN
10633
+  (0.1ms) SAVEPOINT active_record_1
10634
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
10635
+ 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]]
10636
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10637
+ 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]]
10638
+  (0.1ms) SAVEPOINT active_record_1
10639
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10640
+ 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"]]
10641
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10642
+  (0.1ms) ROLLBACK
10643
+  (0.2ms) BEGIN
10644
+  (0.2ms) SAVEPOINT active_record_1
10645
+ Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
10646
+ 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]]
10647
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10648
+ 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]]
10649
+  (0.1ms) SAVEPOINT active_record_1
10650
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10651
+ 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"]]
10652
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10653
+  (0.1ms) ROLLBACK
10654
+  (0.1ms) BEGIN
10655
+  (0.1ms) SAVEPOINT active_record_1
10656
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
10657
+ 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]]
10658
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10659
+  (0.1ms) SAVEPOINT active_record_1
10660
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10661
+ 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]]
10662
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10663
+ 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]]
10664
+  (0.1ms) SAVEPOINT active_record_1
10665
+ 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]]
10666
+ 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]]
10667
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10668
+  (0.1ms) ROLLBACK
10669
+  (0.1ms) BEGIN
10670
+  (0.1ms) SAVEPOINT active_record_1
10671
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
10672
+ 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]]
10673
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10674
+  (0.1ms) SAVEPOINT active_record_1
10675
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10676
+ 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]]
10677
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10678
+ 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]]
10679
+  (0.1ms) SAVEPOINT active_record_1
10680
+ 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]]
10681
+ 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]]
10682
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10683
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 18], ["LIMIT", 1]]
10684
+  (0.2ms) ROLLBACK
10685
+  (0.1ms) BEGIN
10686
+  (0.1ms) SAVEPOINT active_record_1
10687
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
10688
+ 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]]
10689
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10690
+  (0.1ms) SAVEPOINT active_record_1
10691
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10692
+ 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]]
10693
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10694
+ 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]]
10695
+  (0.1ms) SAVEPOINT active_record_1
10696
+ 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]]
10697
+ 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]]
10698
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10699
+ Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 20], ["LIMIT", 1]]
10700
+  (0.2ms) ROLLBACK
10701
+  (0.1ms) BEGIN
10702
+  (0.1ms) SAVEPOINT active_record_1
10703
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]]
10704
+ 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"]]
10705
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10706
+  (0.1ms) SAVEPOINT active_record_1
10707
+ 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]]
10708
+ 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]]
10709
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10710
+ Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 21], ["LIMIT", 1]]
10711
+  (0.2ms) ROLLBACK
10712
+  (0.1ms) BEGIN
10713
+ Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]
10714
+  (0.1ms) SAVEPOINT active_record_1
10715
+ 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"]]
10716
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10717
+  (0.1ms) SAVEPOINT active_record_1
10718
+ 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]]
10719
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10720
+ Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]
10721
+  (0.2ms) ROLLBACK
10722
+  (0.1ms) BEGIN
10723
+ Processing by SessionsController#destroy as HTML
10724
+ Redirected to http://test.host/signed_out
10725
+ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
10726
+  (0.2ms) ROLLBACK
10727
+  (0.1ms) BEGIN
10728
+ Processing by SessionsController#destroy as HTML
10729
+ Redirected to http://test.host/
10730
+ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
10731
+  (0.2ms) ROLLBACK
10732
+  (0.1ms) BEGIN
10733
+ Processing by SessionsController#failure as HTML
10734
+ Rendering /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application
10735
+ Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms)
10736
+ Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
10737
+ Completed 200 OK in 15ms (Views: 10.3ms | ActiveRecord: 0.0ms)
10738
+  (0.1ms) ROLLBACK
10739
+  (0.1ms) BEGIN
10740
+ Processing by SessionsController#failure as HTML
10741
+ Rendering /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application
10742
+ Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms)
10743
+ Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
10744
+ Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)
10745
+  (0.1ms) ROLLBACK
10746
+  (0.1ms) BEGIN
10747
+ Processing by SessionsController#create as HTML
10748
+ Parameters: {"provider"=>"bookingsync"}
10749
+ 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]]
10750
+  (0.2ms) SAVEPOINT active_record_1
10751
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10752
+ 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"]]
10753
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10754
+ Redirected to http://test.host/admin
10755
+ Completed 302 Found in 31ms (ActiveRecord: 8.1ms)
10756
+  (0.1ms) ROLLBACK
10757
+  (0.1ms) BEGIN
10758
+ Processing by SessionsController#create as HTML
10759
+ Parameters: {"provider"=>"bookingsync"}
10760
+ 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]]
10761
+  (0.1ms) SAVEPOINT active_record_1
10762
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10763
+ 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"]]
10764
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10765
+ Redirected to http://test.host/
10766
+ Completed 302 Found in 3ms (ActiveRecord: 0.8ms)
10767
+  (0.1ms) ROLLBACK
10768
+  (0.1ms) BEGIN
10769
+ Processing by SessionsController#create as HTML
10770
+ Parameters: {"provider"=>"bookingsync"}
10771
+ 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]]
10772
+  (0.1ms) SAVEPOINT active_record_1
10773
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10774
+ 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"]]
10775
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10776
+ Redirected to http://test.host/
10777
+ Completed 302 Found in 5ms (ActiveRecord: 1.3ms)
10778
+  (0.1ms) ROLLBACK
10779
+  (0.1ms) BEGIN
10780
+  (0.1ms) ROLLBACK
10781
+  (0.1ms) BEGIN
10782
+  (0.1ms) ROLLBACK
10783
+  (0.1ms) BEGIN
10784
+  (0.1ms) ROLLBACK
10785
+  (0.1ms) BEGIN
10786
+  (0.1ms) ROLLBACK
10787
+  (0.1ms) BEGIN
10788
+  (0.1ms) ROLLBACK
10789
+  (0.1ms) BEGIN
10790
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10791
+ 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"]]
10792
+  (0.5ms) COMMIT
10793
+  (0.1ms) BEGIN
10794
+  (0.1ms) BEGIN
10795
+ 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]]
10796
+ 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]]
10797
+  (0.5ms) COMMIT
10798
+  (0.1ms) ROLLBACK
10799
+ Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 4], ["LIMIT", 1]]
10800
+ Account Load (0.4ms) SELECT "accounts".* FROM "accounts"
10801
+  (0.1ms) BEGIN
10802
+ SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 4]]
10803
+  (0.4ms) COMMIT
10804
+  (0.1ms) BEGIN
10805
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10806
+ 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"]]
10807
+  (0.5ms) COMMIT
10808
+  (0.1ms) BEGIN
10809
+ 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]]
10810
+ 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]]
10811
+  (0.3ms) COMMIT
10812
+ Account Load (0.4ms) SELECT "accounts".* FROM "accounts"
10813
+  (0.2ms) BEGIN
10814
+ SQL (0.7ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 5]]
10815
+  (0.5ms) COMMIT
10816
+  (0.1ms) BEGIN
10817
+  (0.1ms) SAVEPOINT active_record_1
10818
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10819
+ 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"]]
10820
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10821
+  (0.2ms) ROLLBACK
10822
+  (0.1ms) BEGIN
10823
+  (0.1ms) ROLLBACK
10824
+  (0.1ms) BEGIN
10825
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]
10826
+  (0.1ms) SAVEPOINT active_record_1
10827
+ 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"]]
10828
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10829
+  (0.1ms) SAVEPOINT active_record_1
10830
+ 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]]
10831
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10832
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]
10833
+  (0.4ms) ROLLBACK
10834
+  (0.1ms) BEGIN
10835
+  (0.1ms) SAVEPOINT active_record_1
10836
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]]
10837
+ 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"]]
10838
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10839
+  (0.1ms) SAVEPOINT active_record_1
10840
+ 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]]
10841
+ 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]]
10842
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10843
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 8], ["LIMIT", 1]]
10844
+  (0.1ms) ROLLBACK
10845
+  (0.1ms) BEGIN
10846
+  (0.1ms) SAVEPOINT active_record_1
10847
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
10848
+ 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]]
10849
+  (0.3ms) RELEASE SAVEPOINT active_record_1
10850
+  (0.4ms) SELECT COUNT(*) FROM "accounts"
10851
+ 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]]
10852
+  (0.2ms) SAVEPOINT active_record_1
10853
+ Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10854
+ 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"]]
10855
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10856
+  (0.2ms) SELECT COUNT(*) FROM "accounts"
10857
+  (0.1ms) ROLLBACK
10858
+  (0.1ms) BEGIN
10859
+  (0.1ms) SAVEPOINT active_record_1
10860
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
10861
+ 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]]
10862
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10863
+ 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]]
10864
+  (0.1ms) SAVEPOINT active_record_1
10865
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10866
+ 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"]]
10867
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10868
+  (0.1ms) ROLLBACK
10869
+  (0.1ms) BEGIN
10870
+  (0.1ms) SAVEPOINT active_record_1
10871
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
10872
+ 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]]
10873
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10874
+ 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]]
10875
+  (0.1ms) SAVEPOINT active_record_1
10876
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10877
+ 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"]]
10878
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10879
+  (0.1ms) ROLLBACK
10880
+  (0.1ms) BEGIN
10881
+  (0.1ms) SAVEPOINT active_record_1
10882
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
10883
+ 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]]
10884
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10885
+ 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]]
10886
+  (0.1ms) SAVEPOINT active_record_1
10887
+ Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10888
+ 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"]]
10889
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10890
+  (0.1ms) ROLLBACK
10891
+  (0.1ms) BEGIN
10892
+  (0.1ms) SAVEPOINT active_record_1
10893
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
10894
+ 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]]
10895
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10896
+  (0.1ms) SAVEPOINT active_record_1
10897
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10898
+ 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]]
10899
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10900
+ 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]]
10901
+  (0.1ms) SAVEPOINT active_record_1
10902
+ 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]]
10903
+ 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]]
10904
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10905
+  (0.1ms) ROLLBACK
10906
+  (0.1ms) BEGIN
10907
+  (0.1ms) SAVEPOINT active_record_1
10908
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
10909
+ 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]]
10910
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10911
+  (0.1ms) SAVEPOINT active_record_1
10912
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10913
+ 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]]
10914
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10915
+ 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]]
10916
+  (0.1ms) SAVEPOINT active_record_1
10917
+ 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]]
10918
+ 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]]
10919
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10920
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 20], ["LIMIT", 1]]
10921
+  (0.1ms) ROLLBACK
10922
+  (0.1ms) BEGIN
10923
+  (0.1ms) SAVEPOINT active_record_1
10924
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
10925
+ 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]]
10926
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10927
+  (0.1ms) SAVEPOINT active_record_1
10928
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
10929
+ 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]]
10930
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10931
+ 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]]
10932
+  (0.1ms) SAVEPOINT active_record_1
10933
+ 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]]
10934
+ 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]]
10935
+  (0.1ms) RELEASE SAVEPOINT active_record_1
10936
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 22], ["LIMIT", 1]]
10937
+  (0.1ms) ROLLBACK
10938
+  (0.1ms) BEGIN
10939
+ Processing by AuthenticatedController#index as HTML
10940
+ Completed 500 Internal Server Error in 73ms (ActiveRecord: 0.0ms)
10941
+  (0.2ms) ROLLBACK
10942
+  (0.1ms) BEGIN
10943
+ Processing by AuthenticatedController#index as HTML
10944
+ Redirected to http://test.host/auth/bookingsync/?account_id=
10945
+ Filter chain halted as :authenticate_account! rendered or redirected
10946
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
10947
+  (0.1ms) ROLLBACK
10948
+  (0.1ms) BEGIN
10949
+ Processing by AuthenticatedController#index as JS
10950
+ Completed 500 Internal Server Error in 1ms (ActiveRecord: 0.0ms)
10951
+  (0.1ms) ROLLBACK
10952
+  (0.1ms) BEGIN
10953
+ Processing by AuthenticatedController#index as JS
10954
+ Completed 500 Internal Server Error in 1ms (ActiveRecord: 0.0ms)
10955
+  (0.1ms) ROLLBACK
10956
+  (0.1ms) BEGIN
10957
+ Processing by AuthenticatedController#index as HTML
10958
+ Completed 500 Internal Server Error in 94ms (ActiveRecord: 0.0ms)
10959
+  (0.2ms) ROLLBACK
10960
+  (0.1ms) BEGIN
10961
+ Processing by AuthenticatedController#index as HTML
10962
+ Completed 500 Internal Server Error in 88ms (ActiveRecord: 0.0ms)
10963
+  (0.2ms) ROLLBACK
10964
+  (0.1ms) BEGIN
10965
+ Processing by AuthenticatedController#index as HTML
10966
+ Completed 500 Internal Server Error in 93ms (ActiveRecord: 0.0ms)
10967
+  (0.2ms) ROLLBACK
10968
+  (0.1ms) BEGIN
10969
+ Processing by AuthenticatedController#index as HTML
10970
+ Completed 500 Internal Server Error in 93ms (ActiveRecord: 0.0ms)
10971
+  (0.2ms) ROLLBACK
10972
+  (0.1ms) BEGIN
10973
+ Processing by AuthenticatedController#index as HTML
10974
+ Completed 500 Internal Server Error in 97ms (ActiveRecord: 0.0ms)
10975
+  (0.2ms) ROLLBACK
10976
+  (0.1ms) BEGIN
10977
+ Processing by AuthenticatedController#index as HTML
10978
+ Rendering text template
10979
+ Rendered text template (0.0ms)
10980
+ Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
10981
+ Filter chain halted as :authenticate_account! rendered or redirected
10982
+ Completed 200 OK in 5ms (Views: 4.9ms | ActiveRecord: 0.0ms)
10983
+  (0.2ms) ROLLBACK
10984
+  (0.1ms) BEGIN
10985
+  (0.1ms) ROLLBACK
10986
+  (0.1ms) BEGIN
10987
+  (0.1ms) ROLLBACK
10988
+  (0.1ms) BEGIN
10989
+  (0.1ms) ROLLBACK
10990
+  (0.1ms) BEGIN
10991
+  (0.1ms) ROLLBACK
10992
+  (0.1ms) BEGIN
10993
+  (0.1ms) ROLLBACK
10994
+  (0.1ms) BEGIN
10995
+ Processing by AuthenticatedController#index as JS
10996
+ Completed 500 Internal Server Error in 87ms (ActiveRecord: 0.0ms)
10997
+  (0.2ms) ROLLBACK
10998
+  (0.1ms) BEGIN
10999
+ Processing by AuthenticatedController#index as JS
11000
+ Completed 500 Internal Server Error in 1ms (ActiveRecord: 0.0ms)
11001
+  (0.1ms) ROLLBACK
11002
+  (0.1ms) BEGIN
11003
+ Processing by AuthenticatedController#index as HTML
11004
+ Redirected to http://test.host/auth/bookingsync/?account_id=
11005
+ Filter chain halted as :authenticate_account! rendered or redirected
11006
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
11007
+  (0.1ms) ROLLBACK
11008
+  (0.1ms) BEGIN
11009
+ Processing by AuthenticatedController#index as HTML
11010
+ Rendering text template
11011
+ Rendered text template (0.0ms)
11012
+ Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
11013
+ Filter chain halted as :authenticate_account! rendered or redirected
11014
+ Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)
11015
+  (0.1ms) ROLLBACK
11016
+  (0.1ms) BEGIN
11017
+ Processing by SessionsController#create as HTML
11018
+ Parameters: {"provider"=>"bookingsync"}
11019
+ 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]]
11020
+  (0.2ms) SAVEPOINT active_record_1
11021
+ Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
11022
+ 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"]]
11023
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11024
+ Redirected to http://test.host/
11025
+ Completed 302 Found in 34ms (ActiveRecord: 9.8ms)
11026
+  (0.1ms) ROLLBACK
11027
+  (0.1ms) BEGIN
11028
+ Processing by SessionsController#create as HTML
11029
+ Parameters: {"provider"=>"bookingsync"}
11030
+ 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]]
11031
+  (0.1ms) SAVEPOINT active_record_1
11032
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
11033
+ 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"]]
11034
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11035
+ Redirected to http://test.host/admin
11036
+ Completed 302 Found in 4ms (ActiveRecord: 1.0ms)
11037
+  (0.1ms) ROLLBACK
11038
+  (0.2ms) BEGIN
11039
+ Processing by SessionsController#create as HTML
11040
+ Parameters: {"provider"=>"bookingsync"}
11041
+ 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]]
11042
+  (0.2ms) SAVEPOINT active_record_1
11043
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
11044
+ 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"]]
11045
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11046
+ Redirected to http://test.host/
11047
+ Completed 302 Found in 4ms (ActiveRecord: 1.3ms)
11048
+  (0.1ms) ROLLBACK
11049
+  (0.1ms) BEGIN
11050
+ Processing by SessionsController#failure as HTML
11051
+ Rendering /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application
11052
+ Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms)
11053
+ Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
11054
+ Completed 200 OK in 12ms (Views: 7.6ms | ActiveRecord: 0.0ms)
11055
+  (0.2ms) ROLLBACK
11056
+  (0.1ms) BEGIN
11057
+ Processing by SessionsController#failure as HTML
11058
+ Rendering /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application
11059
+ Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms)
11060
+ Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
11061
+ Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)
11062
+  (0.1ms) ROLLBACK
11063
+  (0.1ms) BEGIN
11064
+ Processing by SessionsController#destroy as HTML
11065
+ Redirected to http://test.host/
11066
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
11067
+  (0.1ms) ROLLBACK
11068
+  (0.1ms) BEGIN
11069
+ Processing by SessionsController#destroy as HTML
11070
+ Redirected to http://test.host/signed_out
11071
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
11072
+  (0.1ms) ROLLBACK
11073
+  (0.1ms) BEGIN
11074
+  (0.2ms) ROLLBACK
11075
+  (0.1ms) BEGIN
11076
+  (0.1ms) SAVEPOINT active_record_1
11077
+ Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
11078
+ 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]]
11079
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11080
+  (0.3ms) SELECT COUNT(*) FROM "accounts"
11081
+ 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]]
11082
+  (0.1ms) SAVEPOINT active_record_1
11083
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
11084
+ 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"]]
11085
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11086
+  (0.2ms) SELECT COUNT(*) FROM "accounts"
11087
+  (0.1ms) ROLLBACK
11088
+  (0.1ms) BEGIN
11089
+  (0.1ms) SAVEPOINT active_record_1
11090
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
11091
+ 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]]
11092
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11093
+ 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]]
11094
+  (0.1ms) SAVEPOINT active_record_1
11095
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
11096
+ 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"]]
11097
+  (0.2ms) RELEASE SAVEPOINT active_record_1
11098
+  (0.1ms) ROLLBACK
11099
+  (0.1ms) BEGIN
11100
+  (0.1ms) SAVEPOINT active_record_1
11101
+ Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
11102
+ 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]]
11103
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11104
+ 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]]
11105
+  (0.1ms) SAVEPOINT active_record_1
11106
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
11107
+ 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"]]
11108
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11109
+  (0.1ms) ROLLBACK
11110
+  (0.1ms) BEGIN
11111
+  (0.1ms) SAVEPOINT active_record_1
11112
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
11113
+ 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]]
11114
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11115
+ 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]]
11116
+  (0.1ms) SAVEPOINT active_record_1
11117
+ Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
11118
+ 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"]]
11119
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11120
+  (0.1ms) ROLLBACK
11121
+  (0.1ms) BEGIN
11122
+  (0.2ms) SAVEPOINT active_record_1
11123
+ Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
11124
+ 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]]
11125
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11126
+  (0.1ms) SAVEPOINT active_record_1
11127
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
11128
+ 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]]
11129
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11130
+ 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]]
11131
+  (0.1ms) SAVEPOINT active_record_1
11132
+ 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]]
11133
+ 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]]
11134
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11135
+  (0.1ms) ROLLBACK
11136
+  (0.1ms) BEGIN
11137
+  (0.1ms) SAVEPOINT active_record_1
11138
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
11139
+ 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]]
11140
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11141
+  (0.1ms) SAVEPOINT active_record_1
11142
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
11143
+ 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]]
11144
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11145
+ 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]]
11146
+  (0.1ms) SAVEPOINT active_record_1
11147
+ 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]]
11148
+ 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]]
11149
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11150
+ Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 15], ["LIMIT", 1]]
11151
+  (0.1ms) ROLLBACK
11152
+  (0.1ms) BEGIN
11153
+  (0.1ms) SAVEPOINT active_record_1
11154
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
11155
+ 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]]
11156
+  (0.2ms) RELEASE SAVEPOINT active_record_1
11157
+  (0.1ms) SAVEPOINT active_record_1
11158
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
11159
+ 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]]
11160
+  (0.2ms) RELEASE SAVEPOINT active_record_1
11161
+ 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]]
11162
+  (0.1ms) SAVEPOINT active_record_1
11163
+ 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]]
11164
+ 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]]
11165
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11166
+ Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 17], ["LIMIT", 1]]
11167
+  (0.2ms) ROLLBACK
11168
+  (0.1ms) BEGIN
11169
+  (0.1ms) SAVEPOINT active_record_1
11170
+ Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]]
11171
+ 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"]]
11172
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11173
+  (0.1ms) SAVEPOINT active_record_1
11174
+ 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]]
11175
+ 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]]
11176
+  (0.2ms) RELEASE SAVEPOINT active_record_1
11177
+ Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 18], ["LIMIT", 1]]
11178
+  (0.1ms) ROLLBACK
11179
+  (0.1ms) BEGIN
11180
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
11181
+ 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"]]
11182
+  (0.4ms) COMMIT
11183
+  (0.1ms) BEGIN
11184
+  (0.1ms) BEGIN
11185
+ 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]]
11186
+ 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]]
11187
+  (0.5ms) COMMIT
11188
+  (0.1ms) ROLLBACK
11189
+ Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 19], ["LIMIT", 1]]
11190
+ Account Load (0.3ms) SELECT "accounts".* FROM "accounts"
11191
+  (0.1ms) BEGIN
11192
+ SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 19]]
11193
+  (0.4ms) COMMIT
11194
+  (0.1ms) BEGIN
11195
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
11196
+ 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"]]
11197
+  (0.4ms) COMMIT
11198
+  (0.1ms) BEGIN
11199
+ 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]]
11200
+ 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]]
11201
+  (0.4ms) COMMIT
11202
+ Account Load (0.4ms) SELECT "accounts".* FROM "accounts"
11203
+  (0.5ms) BEGIN
11204
+ SQL (0.6ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 20]]
11205
+  (0.6ms) COMMIT
11206
+  (0.1ms) BEGIN
11207
+  (0.1ms) SAVEPOINT active_record_1
11208
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
11209
+ 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"]]
11210
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11211
+  (0.1ms) ROLLBACK
11212
+  (0.1ms) BEGIN
11213
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]
11214
+  (0.1ms) SAVEPOINT active_record_1
11215
+ 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"]]
11216
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11217
+  (0.1ms) SAVEPOINT active_record_1
11218
+ 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]]
11219
+  (0.2ms) RELEASE SAVEPOINT active_record_1
11220
+ Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]
11221
+  (0.1ms) ROLLBACK
11222
+  (0.1ms) BEGIN
11223
+ Processing by AuthenticatedController#index as HTML
11224
+ Redirected to http://test.host/auth/bookingsync/?account_id=
11225
+ Filter chain halted as :authenticate_account! rendered or redirected
11226
+ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
11227
+  (0.2ms) ROLLBACK
11228
+  (0.1ms) BEGIN
11229
+ Processing by AuthenticatedController#index as HTML
11230
+ Rendering text template
11231
+ Rendered text template (0.0ms)
11232
+ Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
11233
+ Filter chain halted as :authenticate_account! rendered or redirected
11234
+ Completed 200 OK in 3ms (Views: 2.8ms | ActiveRecord: 0.0ms)
11235
+  (0.1ms) ROLLBACK
11236
+  (0.1ms) BEGIN
11237
+ Processing by AuthenticatedController#index as JS
11238
+ Rendering text template
11239
+ Rendered text template (0.0ms)
11240
+ Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
11241
+ Filter chain halted as :authenticate_account! rendered or redirected
11242
+ Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)
11243
+  (0.1ms) ROLLBACK
11244
+  (0.1ms) BEGIN
11245
+ Processing by AuthenticatedController#index as JS
11246
+ Rendering text template
11247
+ Rendered text template (0.0ms)
11248
+ Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
11249
+ Filter chain halted as :authenticate_account! rendered or redirected
11250
+ Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)
11251
+  (0.1ms) ROLLBACK
11252
+  (0.2ms) BEGIN
11253
+ Processing by SessionsController#create as HTML
11254
+ Parameters: {"provider"=>"bookingsync"}
11255
+ 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]]
11256
+  (0.3ms) SAVEPOINT active_record_1
11257
+ Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
11258
+ 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"]]
11259
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11260
+ Redirected to http://test.host/admin
11261
+ Completed 302 Found in 44ms (ActiveRecord: 12.6ms)
11262
+  (0.2ms) ROLLBACK
11263
+  (0.1ms) BEGIN
11264
+ Processing by SessionsController#create as HTML
11265
+ Parameters: {"provider"=>"bookingsync"}
11266
+ 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]]
11267
+  (0.1ms) SAVEPOINT active_record_1
11268
+ Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
11269
+ 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"]]
11270
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11271
+ Redirected to http://test.host/
11272
+ Completed 302 Found in 6ms (ActiveRecord: 1.5ms)
11273
+  (0.1ms) ROLLBACK
11274
+  (0.1ms) BEGIN
11275
+ Processing by SessionsController#create as HTML
11276
+ Parameters: {"provider"=>"bookingsync"}
11277
+ 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]]
11278
+  (0.1ms) SAVEPOINT active_record_1
11279
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
11280
+ 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"]]
11281
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11282
+ Redirected to http://test.host/
11283
+ Completed 302 Found in 5ms (ActiveRecord: 1.3ms)
11284
+  (0.1ms) ROLLBACK
11285
+  (0.1ms) BEGIN
11286
+ Processing by SessionsController#destroy as HTML
11287
+ Redirected to http://test.host/signed_out
11288
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
11289
+  (0.1ms) ROLLBACK
11290
+  (0.2ms) BEGIN
11291
+ Processing by SessionsController#destroy as HTML
11292
+ Redirected to http://test.host/
11293
+ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
11294
+  (0.2ms) ROLLBACK
11295
+  (0.1ms) BEGIN
11296
+ Processing by SessionsController#failure as HTML
11297
+ Rendering /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application
11298
+ Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms)
11299
+ Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
11300
+ Completed 200 OK in 13ms (Views: 7.8ms | ActiveRecord: 0.0ms)
11301
+  (0.2ms) ROLLBACK
11302
+  (0.1ms) BEGIN
11303
+ Processing by SessionsController#failure as HTML
11304
+ Rendering /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application
11305
+ Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms)
11306
+ Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
11307
+ Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)
11308
+  (0.1ms) ROLLBACK
11309
+  (0.1ms) BEGIN
11310
+  (0.1ms) ROLLBACK
11311
+  (0.1ms) BEGIN
11312
+  (0.1ms) ROLLBACK
11313
+  (0.1ms) BEGIN
11314
+  (0.1ms) ROLLBACK
11315
+  (0.1ms) BEGIN
11316
+  (0.1ms) ROLLBACK
11317
+  (0.1ms) BEGIN
11318
+  (0.1ms) ROLLBACK
11319
+  (0.1ms) BEGIN
11320
+ Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]
11321
+  (0.2ms) SAVEPOINT active_record_1
11322
+ 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"]]
11323
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11324
+  (0.1ms) SAVEPOINT active_record_1
11325
+ 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]]
11326
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11327
+ Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]
11328
+  (0.1ms) ROLLBACK
11329
+  (0.1ms) BEGIN
11330
+  (0.1ms) SAVEPOINT active_record_1
11331
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
11332
+ 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]]
11333
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11334
+  (0.3ms) SELECT COUNT(*) FROM "accounts"
11335
+ 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]]
11336
+  (0.1ms) SAVEPOINT active_record_1
11337
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
11338
+ 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"]]
11339
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11340
+  (0.3ms) SELECT COUNT(*) FROM "accounts"
11341
+  (0.2ms) ROLLBACK
11342
+  (0.1ms) BEGIN
11343
+  (0.1ms) SAVEPOINT active_record_1
11344
+ Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
11345
+ 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]]
11346
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11347
+ 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]]
11348
+  (0.1ms) SAVEPOINT active_record_1
11349
+ Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
11350
+ 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"]]
11351
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11352
+  (0.1ms) ROLLBACK
11353
+  (0.1ms) BEGIN
11354
+  (0.1ms) SAVEPOINT active_record_1
11355
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
11356
+ 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]]
11357
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11358
+ 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]]
11359
+  (0.1ms) SAVEPOINT active_record_1
11360
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
11361
+ 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"]]
11362
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11363
+  (0.1ms) ROLLBACK
11364
+  (0.1ms) BEGIN
11365
+  (0.1ms) SAVEPOINT active_record_1
11366
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
11367
+ 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]]
11368
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11369
+ 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]]
11370
+  (0.2ms) SAVEPOINT active_record_1
11371
+ Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
11372
+ 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"]]
11373
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11374
+  (0.1ms) ROLLBACK
11375
+  (0.1ms) BEGIN
11376
+  (0.1ms) SAVEPOINT active_record_1
11377
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
11378
+ 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]]
11379
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11380
+  (0.1ms) SAVEPOINT active_record_1
11381
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
11382
+ 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]]
11383
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11384
+ 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]]
11385
+  (0.1ms) SAVEPOINT active_record_1
11386
+ 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]]
11387
+ 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]]
11388
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11389
+  (0.1ms) ROLLBACK
11390
+  (0.1ms) BEGIN
11391
+  (0.1ms) SAVEPOINT active_record_1
11392
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
11393
+ 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]]
11394
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11395
+  (0.1ms) SAVEPOINT active_record_1
11396
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
11397
+ 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]]
11398
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11399
+ 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]]
11400
+  (0.1ms) SAVEPOINT active_record_1
11401
+ 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]]
11402
+ 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]]
11403
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11404
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 16], ["LIMIT", 1]]
11405
+  (0.1ms) ROLLBACK
11406
+  (0.1ms) BEGIN
11407
+  (0.1ms) SAVEPOINT active_record_1
11408
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
11409
+ 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]]
11410
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11411
+  (0.1ms) SAVEPOINT active_record_1
11412
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
11413
+ 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]]
11414
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11415
+ 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]]
11416
+  (0.1ms) SAVEPOINT active_record_1
11417
+ 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]]
11418
+ 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]]
11419
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11420
+ Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 18], ["LIMIT", 1]]
11421
+  (0.2ms) ROLLBACK
11422
+  (0.1ms) BEGIN
11423
+  (0.1ms) SAVEPOINT active_record_1
11424
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
11425
+ 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"]]
11426
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11427
+  (0.1ms) ROLLBACK
11428
+  (0.1ms) BEGIN
11429
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
11430
+ 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"]]
11431
+  (0.4ms) COMMIT
11432
+  (0.1ms) BEGIN
11433
+ 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]]
11434
+ 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]]
11435
+  (0.5ms) COMMIT
11436
+ Account Load (0.3ms) SELECT "accounts".* FROM "accounts"
11437
+  (0.1ms) BEGIN
11438
+ SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 20]]
11439
+  (0.3ms) COMMIT
11440
+  (0.1ms) BEGIN
11441
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
11442
+ 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"]]
11443
+  (0.4ms) COMMIT
11444
+  (0.1ms) BEGIN
11445
+  (0.1ms) BEGIN
11446
+ 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]]
11447
+ 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]]
11448
+  (0.4ms) COMMIT
11449
+  (0.2ms) ROLLBACK
11450
+ Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 21], ["LIMIT", 1]]
11451
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts"
11452
+  (0.1ms) BEGIN
11453
+ SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 21]]
11454
+  (0.4ms) COMMIT
11455
+  (0.1ms) BEGIN
11456
+  (0.2ms) ROLLBACK
11457
+  (0.1ms) BEGIN
11458
+  (0.1ms) SAVEPOINT active_record_1
11459
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]]
11460
+ 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"]]
11461
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11462
+  (0.1ms) SAVEPOINT active_record_1
11463
+ 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]]
11464
+ 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]]
11465
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11466
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 22], ["LIMIT", 1]]
11467
+  (0.2ms) ROLLBACK
11468
+  (0.1ms) BEGIN
11469
+  (0.2ms) ROLLBACK
11470
+  (0.1ms) BEGIN
11471
+  (0.1ms) SAVEPOINT active_record_1
11472
+ Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
11473
+ 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"]]
11474
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11475
+  (0.1ms) ROLLBACK
11476
+  (0.1ms) BEGIN
11477
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
11478
+ 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"]]
11479
+  (0.3ms) COMMIT
11480
+  (0.1ms) BEGIN
11481
+  (0.1ms) BEGIN
11482
+ Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 2) LIMIT 1
11483
+ 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]]
11484
+  (0.4ms) COMMIT
11485
+  (0.1ms) ROLLBACK
11486
+ Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 2]]
11487
+ Account Load (0.4ms) SELECT "accounts".* FROM "accounts"
11488
+  (0.1ms) BEGIN
11489
+ SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 2]]
11490
+  (0.3ms) COMMIT
11491
+  (0.1ms) BEGIN
11492
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
11493
+ 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"]]
11494
+  (0.5ms) COMMIT
11495
+  (0.1ms) BEGIN
11496
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 3) LIMIT 1
11497
+ 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]]
11498
+  (0.4ms) COMMIT
11499
+ Account Load (0.3ms) SELECT "accounts".* FROM "accounts"
11500
+  (0.1ms) BEGIN
11501
+ SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 3]]
11502
+  (0.3ms) COMMIT
11503
+  (0.1ms) BEGIN
11504
+ Account Load (0.5ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1
11505
+  (0.1ms) SAVEPOINT active_record_1
11506
+ 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"]]
11507
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11508
+  (0.1ms) SAVEPOINT active_record_1
11509
+ 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]]
11510
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11511
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 0 LIMIT 1
11512
+  (0.1ms) ROLLBACK
11513
+  (0.1ms) BEGIN
11514
+  (0.1ms) SAVEPOINT active_record_1
11515
+ Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
11516
+ 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"]]
11517
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11518
+  (0.1ms) SAVEPOINT active_record_1
11519
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
11520
+ 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"]]
11521
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11522
+ Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
11523
+  (0.1ms) SAVEPOINT active_record_1
11524
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 6) LIMIT 1
11525
+ 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]]
11526
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11527
+  (0.1ms) ROLLBACK
11528
+  (0.1ms) BEGIN
11529
+  (0.1ms) SAVEPOINT active_record_1
11530
+ Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
11531
+ 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"]]
11532
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11533
+  (0.1ms) SAVEPOINT active_record_1
11534
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
11535
+ 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"]]
11536
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11537
+ Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
11538
+  (0.1ms) SAVEPOINT active_record_1
11539
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 8) LIMIT 1
11540
+ 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]]
11541
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11542
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 8]]
11543
+  (0.1ms) ROLLBACK
11544
+  (0.1ms) BEGIN
11545
+  (0.1ms) SAVEPOINT active_record_1
11546
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
11547
+ 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"]]
11548
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11549
+  (0.1ms) SAVEPOINT active_record_1
11550
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
11551
+ 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"]]
11552
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11553
+ Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
11554
+  (0.1ms) SAVEPOINT active_record_1
11555
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 10) LIMIT 1
11556
+ 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]]
11557
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11558
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 10]]
11559
+  (0.1ms) ROLLBACK
11560
+  (0.1ms) BEGIN
11561
+  (0.1ms) SAVEPOINT active_record_1
11562
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
11563
+ 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"]]
11564
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11565
+  (0.4ms) SELECT COUNT(*) FROM "accounts"
11566
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
11567
+  (0.1ms) SAVEPOINT active_record_1
11568
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
11569
+ 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"]]
11570
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11571
+  (0.2ms) SELECT COUNT(*) FROM "accounts"
11572
+  (0.1ms) ROLLBACK
11573
+  (0.1ms) BEGIN
11574
+  (0.1ms) SAVEPOINT active_record_1
11575
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
11576
+ 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"]]
11577
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11578
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
11579
+  (0.1ms) SAVEPOINT active_record_1
11580
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
11581
+ 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"]]
11582
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11583
+  (0.1ms) ROLLBACK
11584
+  (0.1ms) BEGIN
11585
+  (0.1ms) SAVEPOINT active_record_1
11586
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
11587
+ 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"]]
11588
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11589
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
11590
+  (0.1ms) SAVEPOINT active_record_1
11591
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
11592
+ 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"]]
11593
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11594
+  (0.1ms) ROLLBACK
11595
+  (0.1ms) BEGIN
11596
+  (0.1ms) SAVEPOINT active_record_1
11597
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
11598
+ 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"]]
11599
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11600
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
11601
+  (0.1ms) SAVEPOINT active_record_1
11602
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
11603
+ 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"]]
11604
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11605
+  (0.1ms) ROLLBACK
11606
+  (0.1ms) BEGIN
11607
+  (0.1ms) SAVEPOINT active_record_1
11608
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1
11609
+ 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"]]
11610
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11611
+  (0.1ms) SAVEPOINT active_record_1
11612
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 19) LIMIT 1
11613
+ 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]]
11614
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11615
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 19]]
11616
+  (0.2ms) ROLLBACK
11617
+  (0.1ms) BEGIN
11618
+  (0.2ms) ROLLBACK
11619
+  (0.1ms) BEGIN
11620
+  (0.1ms) ROLLBACK
11621
+  (0.1ms) BEGIN
11622
+  (0.1ms) ROLLBACK
11623
+  (0.1ms) BEGIN
11624
+  (0.1ms) ROLLBACK
11625
+  (0.1ms) BEGIN
11626
+  (0.1ms) ROLLBACK
11627
+  (0.1ms) BEGIN
11628
+ Processing by SessionsController#create as HTML
11629
+ Parameters: {"params"=>{"provider"=>"bookingsync"}}
11630
+ Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
11631
+  (0.1ms) SAVEPOINT active_record_1
11632
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
11633
+ 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"]]
11634
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11635
+ Redirected to http://test.host/admin
11636
+ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)
11637
+  (0.1ms) ROLLBACK
11638
+  (0.1ms) BEGIN
11639
+ Processing by SessionsController#create as HTML
11640
+ Parameters: {"params"=>{"provider"=>"bookingsync"}}
11641
+ Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
11642
+  (0.1ms) SAVEPOINT active_record_1
11643
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
11644
+ 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"]]
11645
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11646
+ Redirected to http://test.host/
11647
+ Completed 302 Found in 4ms (ActiveRecord: 1.0ms)
11648
+  (0.1ms) ROLLBACK
11649
+  (0.1ms) BEGIN
11650
+ Processing by SessionsController#create as HTML
11651
+ Parameters: {"params"=>{"provider"=>"bookingsync"}}
11652
+ Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
11653
+  (0.1ms) SAVEPOINT active_record_1
11654
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
11655
+ 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"]]
11656
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11657
+ Redirected to http://test.host/
11658
+ Completed 302 Found in 4ms (ActiveRecord: 1.1ms)
11659
+  (0.1ms) ROLLBACK
11660
+  (0.1ms) BEGIN
11661
+ Processing by SessionsController#failure as HTML
11662
+ Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms)
11663
+ Completed 200 OK in 19ms (Views: 18.5ms | ActiveRecord: 0.0ms)
11664
+  (0.1ms) ROLLBACK
11665
+  (0.1ms) BEGIN
11666
+ Processing by SessionsController#failure as HTML
11667
+ Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms)
11668
+ Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)
11669
+  (0.1ms) ROLLBACK
11670
+  (0.1ms) BEGIN
11671
+ Processing by SessionsController#destroy as HTML
11672
+ Redirected to http://test.host/
11673
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
11674
+  (0.1ms) ROLLBACK
11675
+  (0.1ms) BEGIN
11676
+ Processing by SessionsController#destroy as HTML
11677
+ Redirected to http://test.host/signed_out
11678
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
11679
+  (0.1ms) ROLLBACK
11680
+  (0.1ms) BEGIN
11681
+ Processing by AuthenticatedController#index as HTML
11682
+ Rendered text template (0.0ms)
11683
+ Filter chain halted as :authenticate_account! rendered or redirected
11684
+ Completed 200 OK in 4ms (Views: 3.7ms | ActiveRecord: 0.0ms)
11685
+  (0.2ms) ROLLBACK
11686
+  (0.1ms) BEGIN
11687
+ Processing by AuthenticatedController#index as HTML
11688
+ Redirected to http://test.host/auth/bookingsync/?account_id=
11689
+ Filter chain halted as :authenticate_account! rendered or redirected
11690
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
11691
+  (0.1ms) ROLLBACK
11692
+  (0.1ms) BEGIN
11693
+ Processing by AuthenticatedController#index as HTML
11694
+ Parameters: {"xhr"=>true}
11695
+ Rendered text template (0.0ms)
11696
+ Filter chain halted as :authenticate_account! rendered or redirected
11697
+ Completed 200 OK in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)
11698
+  (0.1ms) ROLLBACK
11699
+  (0.1ms) BEGIN
11700
+ Processing by AuthenticatedController#index as HTML
11701
+ Parameters: {"xhr"=>true}
11702
+ Redirected to http://test.host/auth/bookingsync/?account_id=
11703
+ Filter chain halted as :authenticate_account! rendered or redirected
11704
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
11705
+  (0.1ms) ROLLBACK
11706
+  (0.1ms) BEGIN
11707
+ Processing by SessionsController#destroy as HTML
11708
+ Redirected to http://test.host/
11709
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
11710
+  (0.2ms) ROLLBACK
11711
+  (0.1ms) BEGIN
11712
+ Processing by SessionsController#destroy as HTML
11713
+ Redirected to http://test.host/signed_out
11714
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
11715
+  (0.1ms) ROLLBACK
11716
+  (0.1ms) BEGIN
11717
+ Processing by SessionsController#failure as HTML
11718
+ Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms)
11719
+ Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
11720
+ Completed 200 OK in 15ms (Views: 15.1ms | ActiveRecord: 0.0ms)
11721
+  (0.1ms) ROLLBACK
11722
+  (0.1ms) BEGIN
11723
+ Processing by SessionsController#failure as HTML
11724
+ Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms)
11725
+ Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
11726
+ Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)
11727
+  (0.1ms) ROLLBACK
11728
+  (0.1ms) BEGIN
11729
+ Processing by SessionsController#create as HTML
11730
+ Parameters: {"params"=>{"provider"=>"bookingsync"}}
11731
+ Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
11732
+  (0.1ms) SAVEPOINT active_record_1
11733
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
11734
+ 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"]]
11735
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11736
+ Redirected to http://test.host/admin
11737
+ Completed 302 Found in 31ms (ActiveRecord: 5.6ms)
11738
+  (0.1ms) ROLLBACK
11739
+  (0.1ms) BEGIN
11740
+ Processing by SessionsController#create as HTML
11741
+ Parameters: {"params"=>{"provider"=>"bookingsync"}}
11742
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
11743
+  (0.1ms) SAVEPOINT active_record_1
11744
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
11745
+ 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"]]
11746
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11747
+ Redirected to http://test.host/
11748
+ Completed 302 Found in 3ms (ActiveRecord: 0.7ms)
11749
+  (0.1ms) ROLLBACK
11750
+  (0.1ms) BEGIN
11751
+ Processing by SessionsController#create as HTML
11752
+ Parameters: {"params"=>{"provider"=>"bookingsync"}}
11753
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
11754
+  (0.1ms) SAVEPOINT active_record_1
11755
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
11756
+ 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"]]
11757
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11758
+ Redirected to http://test.host/
11759
+ Completed 302 Found in 3ms (ActiveRecord: 0.7ms)
11760
+  (0.1ms) ROLLBACK
11761
+  (0.1ms) BEGIN
11762
+  (0.1ms) ROLLBACK
11763
+  (0.1ms) BEGIN
11764
+  (0.1ms) ROLLBACK
11765
+  (0.1ms) BEGIN
11766
+  (0.1ms) ROLLBACK
11767
+  (0.1ms) BEGIN
11768
+  (0.1ms) ROLLBACK
11769
+  (0.1ms) BEGIN
11770
+  (0.1ms) ROLLBACK
11771
+  (0.1ms) BEGIN
11772
+ Processing by AuthenticatedController#index as HTML
11773
+ Rendered text template (0.0ms)
11774
+ Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
11775
+ Filter chain halted as :authenticate_account! rendered or redirected
11776
+ Completed 200 OK in 4ms (Views: 4.0ms | ActiveRecord: 0.0ms)
11777
+  (0.1ms) ROLLBACK
11778
+  (0.1ms) BEGIN
11779
+ Processing by AuthenticatedController#index as HTML
11780
+ Redirected to http://test.host/auth/bookingsync/?account_id=
11781
+ Filter chain halted as :authenticate_account! rendered or redirected
11782
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
11783
+  (0.1ms) ROLLBACK
11784
+  (0.1ms) BEGIN
11785
+ Processing by AuthenticatedController#index as HTML
11786
+ Parameters: {"xhr"=>true}
11787
+ Rendered text template (0.0ms)
11788
+ Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
11789
+ Filter chain halted as :authenticate_account! rendered or redirected
11790
+ Completed 200 OK in 0ms (Views: 0.3ms | ActiveRecord: 0.0ms)
11791
+  (0.1ms) ROLLBACK
11792
+  (0.1ms) BEGIN
11793
+ Processing by AuthenticatedController#index as HTML
11794
+ Parameters: {"xhr"=>true}
11795
+ Redirected to http://test.host/auth/bookingsync/?account_id=
11796
+ Filter chain halted as :authenticate_account! rendered or redirected
11797
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
11798
+  (0.1ms) ROLLBACK
11799
+  (0.1ms) BEGIN
11800
+  (0.1ms) SAVEPOINT active_record_1
11801
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
11802
+ 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"]]
11803
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11804
+  (0.1ms) ROLLBACK
11805
+  (0.1ms) BEGIN
11806
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
11807
+ 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"]]
11808
+  (0.4ms) COMMIT
11809
+  (0.1ms) BEGIN
11810
+  (0.1ms) BEGIN
11811
+ Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 5) LIMIT 1
11812
+ 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]]
11813
+  (0.5ms) COMMIT
11814
+  (0.1ms) ROLLBACK
11815
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 5]]
11816
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts"
11817
+  (0.1ms) BEGIN
11818
+ SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 5]]
11819
+  (0.3ms) COMMIT
11820
+  (0.1ms) BEGIN
11821
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
11822
+ 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"]]
11823
+  (0.4ms) COMMIT
11824
+  (0.1ms) BEGIN
11825
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 6) LIMIT 1
11826
+ 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]]
11827
+  (0.3ms) COMMIT
11828
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts"
11829
+  (0.1ms) BEGIN
11830
+ SQL (0.1ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 6]]
11831
+  (0.3ms) COMMIT
11832
+  (0.1ms) BEGIN
11833
+  (0.1ms) SAVEPOINT active_record_1
11834
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
11835
+ 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"]]
11836
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11837
+  (0.3ms) SELECT COUNT(*) FROM "accounts"
11838
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
11839
+  (0.1ms) SAVEPOINT active_record_1
11840
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
11841
+ 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"]]
11842
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11843
+  (0.1ms) SELECT COUNT(*) FROM "accounts"
11844
+  (0.1ms) ROLLBACK
11845
+  (0.1ms) BEGIN
11846
+  (0.1ms) SAVEPOINT active_record_1
11847
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
11848
+ 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"]]
11849
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11850
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
11851
+  (0.1ms) SAVEPOINT active_record_1
11852
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
11853
+ 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"]]
11854
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11855
+  (0.1ms) ROLLBACK
11856
+  (0.0ms) BEGIN
11857
+  (0.1ms) SAVEPOINT active_record_1
11858
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
11859
+ 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"]]
11860
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11861
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
11862
+  (0.1ms) SAVEPOINT active_record_1
11863
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
11864
+ 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"]]
11865
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11866
+  (0.1ms) ROLLBACK
11867
+  (0.1ms) BEGIN
11868
+  (0.1ms) SAVEPOINT active_record_1
11869
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
11870
+ 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"]]
11871
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11872
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
11873
+  (0.1ms) SAVEPOINT active_record_1
11874
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
11875
+ 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"]]
11876
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11877
+  (0.1ms) ROLLBACK
11878
+  (0.1ms) BEGIN
11879
+  (0.1ms) SAVEPOINT active_record_1
11880
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
11881
+ 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"]]
11882
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11883
+  (0.1ms) SAVEPOINT active_record_1
11884
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
11885
+ 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"]]
11886
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11887
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
11888
+  (0.1ms) SAVEPOINT active_record_1
11889
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 16) LIMIT 1
11890
+ 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]]
11891
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11892
+  (0.1ms) ROLLBACK
11893
+  (0.1ms) BEGIN
11894
+  (0.1ms) SAVEPOINT active_record_1
11895
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
11896
+ 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"]]
11897
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11898
+  (0.1ms) SAVEPOINT active_record_1
11899
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
11900
+ 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"]]
11901
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11902
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
11903
+  (0.1ms) SAVEPOINT active_record_1
11904
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 18) LIMIT 1
11905
+ 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]]
11906
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11907
+ Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 18]]
11908
+  (0.1ms) ROLLBACK
11909
+  (0.0ms) BEGIN
11910
+  (0.1ms) SAVEPOINT active_record_1
11911
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
11912
+ 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"]]
11913
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11914
+  (0.1ms) SAVEPOINT active_record_1
11915
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
11916
+ 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"]]
11917
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11918
+ Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
11919
+  (0.1ms) SAVEPOINT active_record_1
11920
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 20) LIMIT 1
11921
+ 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]]
11922
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11923
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 20]]
11924
+  (0.2ms) ROLLBACK
11925
+  (0.1ms) BEGIN
11926
+  (0.1ms) ROLLBACK
11927
+  (0.1ms) BEGIN
11928
+ Account Load (0.6ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1
11929
+  (0.1ms) SAVEPOINT active_record_1
11930
+ 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"]]
11931
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11932
+  (0.1ms) SAVEPOINT active_record_1
11933
+ 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]]
11934
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11935
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 0 LIMIT 1
11936
+  (0.1ms) ROLLBACK
11937
+  (0.1ms) BEGIN
11938
+  (0.1ms) SAVEPOINT active_record_1
11939
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1
11940
+ 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"]]
11941
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11942
+  (0.1ms) SAVEPOINT active_record_1
11943
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 22) LIMIT 1
11944
+ 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]]
11945
+  (0.1ms) RELEASE SAVEPOINT active_record_1
11946
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 22]]
11947
+  (0.1ms) ROLLBACK
11948
+  (0.1ms) BEGIN
11949
+  (0.1ms) ROLLBACK
11950
+  (0.1ms) BEGIN
11951
+  (0.1ms) ROLLBACK
11952
+  (0.1ms) BEGIN
11953
+  (0.1ms) ROLLBACK
11954
+  (0.1ms) BEGIN
11955
+  (0.1ms) ROLLBACK
11956
+  (0.1ms) BEGIN
11957
+  (0.1ms) ROLLBACK
11958
+  (0.1ms) BEGIN
11959
+ Processing by AuthenticatedController#index as HTML
11960
+ Redirected to http://test.host/auth/bookingsync/?account_id=
11961
+ Filter chain halted as :authenticate_account! rendered or redirected
11962
+ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
11963
+  (0.2ms) ROLLBACK
11964
+  (0.1ms) BEGIN
11965
+ Processing by AuthenticatedController#index as HTML
11966
+ Rendered text template (0.0ms)
11967
+ Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
11968
+ Filter chain halted as :authenticate_account! rendered or redirected
11969
+ Completed 200 OK in 8ms (Views: 8.0ms | ActiveRecord: 0.0ms)
11970
+  (0.2ms) ROLLBACK
11971
+  (0.1ms) BEGIN
11972
+ Processing by AuthenticatedController#index as HTML
11973
+ Parameters: {"xhr"=>true}
11974
+ Rendered text template (0.0ms)
11975
+ Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
11976
+ Filter chain halted as :authenticate_account! rendered or redirected
11977
+ Completed 200 OK in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)
11978
+  (0.1ms) ROLLBACK
11979
+  (0.1ms) BEGIN
11980
+ Processing by AuthenticatedController#index as HTML
11981
+ Parameters: {"xhr"=>true}
11982
+ Redirected to http://test.host/auth/bookingsync/?account_id=
11983
+ Filter chain halted as :authenticate_account! rendered or redirected
11984
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
11985
+  (0.1ms) ROLLBACK
11986
+  (0.1ms) BEGIN
11987
+ Processing by SessionsController#destroy as HTML
11988
+ Redirected to http://test.host/
11989
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
11990
+  (0.1ms) ROLLBACK
11991
+  (0.1ms) BEGIN
11992
+ Processing by SessionsController#destroy as HTML
11993
+ Redirected to http://test.host/signed_out
11994
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
11995
+  (0.1ms) ROLLBACK
11996
+  (0.1ms) BEGIN
11997
+ Processing by SessionsController#create as HTML
11998
+ Parameters: {"params"=>{"provider"=>"bookingsync"}}
11999
+ Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
12000
+  (0.2ms) SAVEPOINT active_record_1
12001
+ Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
12002
+ 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"]]
12003
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12004
+ Redirected to http://test.host/admin
12005
+ Completed 302 Found in 30ms (ActiveRecord: 6.5ms)
12006
+  (0.1ms) ROLLBACK
12007
+  (0.1ms) BEGIN
12008
+ Processing by SessionsController#create as HTML
12009
+ Parameters: {"params"=>{"provider"=>"bookingsync"}}
12010
+ Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
12011
+  (0.1ms) SAVEPOINT active_record_1
12012
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
12013
+ 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"]]
12014
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12015
+ Redirected to http://test.host/
12016
+ Completed 302 Found in 4ms (ActiveRecord: 1.0ms)
12017
+  (0.1ms) ROLLBACK
12018
+  (0.1ms) BEGIN
12019
+ Processing by SessionsController#create as HTML
12020
+ Parameters: {"params"=>{"provider"=>"bookingsync"}}
12021
+ Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
12022
+  (0.1ms) SAVEPOINT active_record_1
12023
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
12024
+ 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"]]
12025
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12026
+ Redirected to http://test.host/
12027
+ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)
12028
+  (0.1ms) ROLLBACK
12029
+  (0.1ms) BEGIN
12030
+ Processing by SessionsController#failure as HTML
12031
+ Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms)
12032
+ Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
12033
+ Completed 200 OK in 11ms (Views: 11.0ms | ActiveRecord: 0.0ms)
12034
+  (0.1ms) ROLLBACK
12035
+  (0.1ms) BEGIN
12036
+ Processing by SessionsController#failure as HTML
12037
+ Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms)
12038
+ Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
12039
+ Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)
12040
+  (0.1ms) ROLLBACK
12041
+  (0.1ms) BEGIN
12042
+  (0.1ms) SAVEPOINT active_record_1
12043
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1
12044
+ 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"]]
12045
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12046
+  (0.1ms) SAVEPOINT active_record_1
12047
+ Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 4) LIMIT 1
12048
+ 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]]
12049
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12050
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 4]]
12051
+  (0.1ms) ROLLBACK
12052
+  (0.1ms) BEGIN
12053
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
12054
+ 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"]]
12055
+  (0.4ms) COMMIT
12056
+  (0.1ms) BEGIN
12057
+ Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 5) LIMIT 1
12058
+ 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]]
12059
+  (0.4ms) COMMIT
12060
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts"
12061
+  (0.1ms) BEGIN
12062
+ SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 5]]
12063
+  (0.3ms) COMMIT
12064
+  (0.1ms) BEGIN
12065
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
12066
+ 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"]]
12067
+  (0.3ms) COMMIT
12068
+  (0.1ms) BEGIN
12069
+  (0.1ms) BEGIN
12070
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 6) LIMIT 1
12071
+ 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]]
12072
+  (0.4ms) COMMIT
12073
+  (0.1ms) ROLLBACK
12074
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 6]]
12075
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts"
12076
+  (0.1ms) BEGIN
12077
+ SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 6]]
12078
+  (0.3ms) COMMIT
12079
+  (0.1ms) BEGIN
12080
+  (0.1ms) SAVEPOINT active_record_1
12081
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
12082
+ 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"]]
12083
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12084
+  (0.1ms) ROLLBACK
12085
+  (0.1ms) BEGIN
12086
+  (0.1ms) SAVEPOINT active_record_1
12087
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
12088
+ 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"]]
12089
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12090
+  (0.1ms) SAVEPOINT active_record_1
12091
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
12092
+ 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"]]
12093
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12094
+ Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
12095
+  (0.1ms) SAVEPOINT active_record_1
12096
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 9) LIMIT 1
12097
+ 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]]
12098
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12099
+  (0.1ms) ROLLBACK
12100
+  (0.1ms) BEGIN
12101
+  (0.1ms) SAVEPOINT active_record_1
12102
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
12103
+ 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"]]
12104
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12105
+  (0.1ms) SAVEPOINT active_record_1
12106
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
12107
+ 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"]]
12108
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12109
+ Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
12110
+  (0.1ms) SAVEPOINT active_record_1
12111
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 11) LIMIT 1
12112
+ 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]]
12113
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12114
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 11]]
12115
+  (0.1ms) ROLLBACK
12116
+  (0.1ms) BEGIN
12117
+  (0.1ms) SAVEPOINT active_record_1
12118
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
12119
+ 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"]]
12120
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12121
+  (0.1ms) SAVEPOINT active_record_1
12122
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
12123
+ 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"]]
12124
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12125
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
12126
+  (0.1ms) SAVEPOINT active_record_1
12127
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 13) LIMIT 1
12128
+ 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]]
12129
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12130
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 13]]
12131
+  (0.1ms) ROLLBACK
12132
+  (0.1ms) BEGIN
12133
+  (0.1ms) SAVEPOINT active_record_1
12134
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
12135
+ 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"]]
12136
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12137
+  (0.3ms) SELECT COUNT(*) FROM "accounts"
12138
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
12139
+  (0.1ms) SAVEPOINT active_record_1
12140
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
12141
+ 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"]]
12142
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12143
+  (0.2ms) SELECT COUNT(*) FROM "accounts"
12144
+  (0.1ms) ROLLBACK
12145
+  (0.1ms) BEGIN
12146
+  (0.1ms) SAVEPOINT active_record_1
12147
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
12148
+ 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"]]
12149
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12150
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
12151
+  (0.1ms) SAVEPOINT active_record_1
12152
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
12153
+ 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"]]
12154
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12155
+  (0.1ms) ROLLBACK
12156
+  (0.1ms) BEGIN
12157
+  (0.1ms) SAVEPOINT active_record_1
12158
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
12159
+ 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"]]
12160
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12161
+ Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
12162
+  (0.1ms) SAVEPOINT active_record_1
12163
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
12164
+ 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"]]
12165
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12166
+  (0.1ms) ROLLBACK
12167
+  (0.1ms) BEGIN
12168
+  (0.1ms) SAVEPOINT active_record_1
12169
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
12170
+ 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"]]
12171
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12172
+ Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
12173
+  (0.1ms) SAVEPOINT active_record_1
12174
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
12175
+ 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"]]
12176
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12177
+  (0.1ms) ROLLBACK
12178
+  (0.1ms) BEGIN
12179
+ Account Load (0.5ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1
12180
+  (0.1ms) SAVEPOINT active_record_1
12181
+ 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"]]
12182
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12183
+  (0.1ms) SAVEPOINT active_record_1
12184
+ 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]]
12185
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12186
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 0 LIMIT 1
12187
+  (0.1ms) ROLLBACK
12188
+  (0.1ms) BEGIN
12189
+  (0.2ms) ROLLBACK
12190
+  (0.1ms) BEGIN
12191
+ Account Load (1.0ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT 1
12192
+  (0.2ms) SAVEPOINT active_record_1
12193
+ 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"]]
12194
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12195
+  (0.1ms) SAVEPOINT active_record_1
12196
+ 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]]
12197
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12198
+ Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 0 LIMIT 1
12199
+  (0.2ms) ROLLBACK
12200
+  (0.1ms) BEGIN
12201
+  (0.1ms) SAVEPOINT active_record_1
12202
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
12203
+ 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"]]
12204
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12205
+  (0.1ms) ROLLBACK
12206
+  (0.1ms) BEGIN
12207
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
12208
+ 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"]]
12209
+  (0.4ms) COMMIT
12210
+  (0.1ms) BEGIN
12211
+  (0.1ms) BEGIN
12212
+ Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 3) LIMIT 1
12213
+ 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]]
12214
+  (0.4ms) COMMIT
12215
+  (0.1ms) ROLLBACK
12216
+ Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 3]]
12217
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts"
12218
+  (0.1ms) BEGIN
12219
+ SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 3]]
12220
+  (0.4ms) COMMIT
12221
+  (0.1ms) BEGIN
12222
+ Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
12223
+ 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"]]
12224
+  (0.4ms) COMMIT
12225
+  (0.3ms) BEGIN
12226
+ Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 4) LIMIT 1
12227
+ 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]]
12228
+  (0.4ms) COMMIT
12229
+ Account Load (0.4ms) SELECT "accounts".* FROM "accounts"
12230
+  (0.1ms) BEGIN
12231
+ SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 4]]
12232
+  (0.4ms) COMMIT
12233
+  (0.1ms) BEGIN
12234
+  (0.1ms) SAVEPOINT active_record_1
12235
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
12236
+ 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"]]
12237
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12238
+  (0.1ms) SAVEPOINT active_record_1
12239
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
12240
+ 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"]]
12241
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12242
+ Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
12243
+  (0.1ms) SAVEPOINT active_record_1
12244
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 6) LIMIT 1
12245
+ 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]]
12246
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12247
+  (0.1ms) ROLLBACK
12248
+  (0.1ms) BEGIN
12249
+  (0.1ms) SAVEPOINT active_record_1
12250
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
12251
+ 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"]]
12252
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12253
+  (0.1ms) SAVEPOINT active_record_1
12254
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
12255
+ 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"]]
12256
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12257
+ Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
12258
+  (0.1ms) SAVEPOINT active_record_1
12259
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 8) LIMIT 1
12260
+ 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]]
12261
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12262
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 8]]
12263
+  (0.1ms) ROLLBACK
12264
+  (0.1ms) BEGIN
12265
+  (0.1ms) SAVEPOINT active_record_1
12266
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
12267
+ 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"]]
12268
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12269
+  (0.1ms) SAVEPOINT active_record_1
12270
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
12271
+ 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"]]
12272
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12273
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
12274
+  (0.1ms) SAVEPOINT active_record_1
12275
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" = 123 AND "accounts"."id" != 10) LIMIT 1
12276
+ 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]]
12277
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12278
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 10]]
12279
+  (0.1ms) ROLLBACK
12280
+  (0.1ms) BEGIN
12281
+  (0.1ms) SAVEPOINT active_record_1
12282
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
12283
+ 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"]]
12284
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12285
+  (0.6ms) SELECT COUNT(*) FROM "accounts"
12286
+ Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
12287
+  (0.1ms) SAVEPOINT active_record_1
12288
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
12289
+ 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"]]
12290
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12291
+  (0.2ms) SELECT COUNT(*) FROM "accounts"
12292
+  (0.1ms) ROLLBACK
12293
+  (0.1ms) BEGIN
12294
+  (0.1ms) SAVEPOINT active_record_1
12295
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
12296
+ 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"]]
12297
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12298
+ Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
12299
+  (0.1ms) SAVEPOINT active_record_1
12300
+ Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
12301
+ 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"]]
12302
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12303
+  (0.1ms) ROLLBACK
12304
+  (0.1ms) BEGIN
12305
+  (0.1ms) SAVEPOINT active_record_1
12306
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
12307
+ 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"]]
12308
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12309
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
12310
+  (0.1ms) SAVEPOINT active_record_1
12311
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
12312
+ 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"]]
12313
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12314
+  (0.1ms) ROLLBACK
12315
+  (0.1ms) BEGIN
12316
+  (0.1ms) SAVEPOINT active_record_1
12317
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 456 LIMIT 1
12318
+ 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"]]
12319
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12320
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
12321
+  (0.1ms) SAVEPOINT active_record_1
12322
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
12323
+ 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"]]
12324
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12325
+  (0.1ms) ROLLBACK
12326
+  (0.1ms) BEGIN
12327
+  (0.1ms) SAVEPOINT active_record_1
12328
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT 1
12329
+ 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"]]
12330
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12331
+  (0.1ms) SAVEPOINT active_record_1
12332
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE ("accounts"."synced_id" IS NULL AND "accounts"."id" != 19) LIMIT 1
12333
+ 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]]
12334
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12335
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 19]]
12336
+  (0.1ms) ROLLBACK
12337
+  (0.1ms) BEGIN
12338
+  (0.2ms) ROLLBACK
12339
+  (0.1ms) BEGIN
12340
+  (0.1ms) ROLLBACK
12341
+  (0.1ms) BEGIN
12342
+  (0.1ms) ROLLBACK
12343
+  (0.1ms) BEGIN
12344
+  (0.1ms) ROLLBACK
12345
+  (0.1ms) BEGIN
12346
+  (0.1ms) ROLLBACK
12347
+  (0.1ms) BEGIN
12348
+  (0.1ms) ROLLBACK
12349
+  (0.1ms) BEGIN
12350
+ Processing by SessionsController#failure as HTML
12351
+ Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms)
12352
+ Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
12353
+ Completed 200 OK in 17ms (Views: 17.3ms | ActiveRecord: 0.0ms)
12354
+  (0.2ms) ROLLBACK
12355
+  (0.1ms) BEGIN
12356
+ Processing by SessionsController#failure as HTML
12357
+ Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms)
12358
+ Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
12359
+ Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)
12360
+  (0.1ms) ROLLBACK
12361
+  (0.1ms) BEGIN
12362
+ Processing by SessionsController#destroy as HTML
12363
+ Redirected to http://test.host/
12364
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
12365
+  (0.2ms) ROLLBACK
12366
+  (0.1ms) BEGIN
12367
+ Processing by SessionsController#destroy as HTML
12368
+ Redirected to http://test.host/signed_out
12369
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
12370
+  (0.1ms) ROLLBACK
12371
+  (0.1ms) BEGIN
12372
+ Processing by SessionsController#create as HTML
12373
+ Parameters: {"params"=>{"provider"=>"bookingsync"}}
12374
+ Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
12375
+  (0.1ms) SAVEPOINT active_record_1
12376
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
12377
+ 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"]]
12378
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12379
+ Redirected to http://test.host/admin
12380
+ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)
12381
+  (0.1ms) ROLLBACK
12382
+  (0.1ms) BEGIN
12383
+ Processing by SessionsController#create as HTML
12384
+ Parameters: {"params"=>{"provider"=>"bookingsync"}}
12385
+ Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
12386
+  (0.1ms) SAVEPOINT active_record_1
12387
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
12388
+ 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"]]
12389
+  (0.2ms) RELEASE SAVEPOINT active_record_1
12390
+ Redirected to http://test.host/
12391
+ Completed 302 Found in 5ms (ActiveRecord: 1.5ms)
12392
+  (0.1ms) ROLLBACK
12393
+  (0.1ms) BEGIN
12394
+ Processing by SessionsController#create as HTML
12395
+ Parameters: {"params"=>{"provider"=>"bookingsync"}}
12396
+ Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT 1 [["synced_id", 123], ["provider", "bookingsync"]]
12397
+  (0.1ms) SAVEPOINT active_record_1
12398
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = 123 LIMIT 1
12399
+ 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"]]
12400
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12401
+ Redirected to http://test.host/
12402
+ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)
12403
+  (0.2ms) ROLLBACK
12404
+  (0.1ms) BEGIN
12405
+ Processing by AuthenticatedController#index as HTML
12406
+ Parameters: {"xhr"=>true}
12407
+ Redirected to http://test.host/auth/bookingsync/?account_id=
12408
+ Filter chain halted as :authenticate_account! rendered or redirected
12409
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
12410
+  (0.2ms) ROLLBACK
12411
+  (0.1ms) BEGIN
12412
+ Processing by AuthenticatedController#index as HTML
12413
+ Parameters: {"xhr"=>true}
12414
+ Rendered text template (0.0ms)
12415
+ Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
12416
+ Filter chain halted as :authenticate_account! rendered or redirected
12417
+ Completed 200 OK in 5ms (Views: 4.7ms | ActiveRecord: 0.0ms)
12418
+  (0.1ms) ROLLBACK
12419
+  (0.1ms) BEGIN
12420
+ Processing by AuthenticatedController#index as HTML
12421
+ Rendered text template (0.0ms)
12422
+ Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
12423
+ Filter chain halted as :authenticate_account! rendered or redirected
12424
+ Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)
12425
+  (0.2ms) ROLLBACK
12426
+  (0.1ms) BEGIN
12427
+ Processing by AuthenticatedController#index as HTML
12428
+ Redirected to http://test.host/auth/bookingsync/?account_id=
12429
+ Filter chain halted as :authenticate_account! rendered or redirected
12430
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
12431
+  (0.1ms) ROLLBACK
12432
+  (0.1ms) BEGIN
12433
+ Processing by AuthenticatedController#index as HTML
12434
+ Redirected to http://test.host/auth/bookingsync/?account_id=
12435
+ Filter chain halted as :authenticate_account! rendered or redirected
12436
+ Completed 302 Found in 4ms (ActiveRecord: 0.0ms)
12437
+  (0.1ms) ROLLBACK
12438
+  (0.1ms) BEGIN
12439
+ Processing by AuthenticatedController#index as HTML
12440
+ Rendering text template
12441
+ Rendered text template (0.0ms)
12442
+ Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
12443
+ Filter chain halted as :authenticate_account! rendered or redirected
12444
+ Completed 200 OK in 9ms (Views: 8.5ms | ActiveRecord: 0.0ms)
12445
+  (0.1ms) ROLLBACK
12446
+  (0.1ms) BEGIN
12447
+ Processing by AuthenticatedController#index as JS
12448
+ Rendering text template
12449
+ Rendered text template (0.0ms)
12450
+ Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
12451
+ Filter chain halted as :authenticate_account! rendered or redirected
12452
+ Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)
12453
+  (0.1ms) ROLLBACK
12454
+  (0.1ms) BEGIN
12455
+ Processing by AuthenticatedController#index as JS
12456
+ Rendering text template
12457
+ Rendered text template (0.0ms)
12458
+ Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
12459
+ Filter chain halted as :authenticate_account! rendered or redirected
12460
+ Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)
12461
+  (0.1ms) ROLLBACK
12462
+  (0.1ms) BEGIN
12463
+ Processing by SessionsController#create as HTML
12464
+ Parameters: {"provider"=>"bookingsync"}
12465
+ 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]]
12466
+  (0.2ms) SAVEPOINT active_record_1
12467
+ Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
12468
+ 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"]]
12469
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12470
+ Redirected to http://test.host/admin
12471
+ Completed 302 Found in 48ms (ActiveRecord: 11.3ms)
12472
+  (0.2ms) ROLLBACK
12473
+  (0.1ms) BEGIN
12474
+ Processing by SessionsController#create as HTML
12475
+ Parameters: {"provider"=>"bookingsync"}
12476
+ 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]]
12477
+  (0.1ms) SAVEPOINT active_record_1
12478
+ Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
12479
+ 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"]]
12480
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12481
+ Redirected to http://test.host/
12482
+ Completed 302 Found in 6ms (ActiveRecord: 1.5ms)
12483
+  (0.1ms) ROLLBACK
12484
+  (0.1ms) BEGIN
12485
+ Processing by SessionsController#create as HTML
12486
+ Parameters: {"provider"=>"bookingsync"}
12487
+ 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]]
12488
+  (0.1ms) SAVEPOINT active_record_1
12489
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
12490
+ 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"]]
12491
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12492
+ Redirected to http://test.host/
12493
+ Completed 302 Found in 5ms (ActiveRecord: 1.2ms)
12494
+  (0.1ms) ROLLBACK
12495
+  (0.1ms) BEGIN
12496
+ Processing by SessionsController#failure as HTML
12497
+ Rendering /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application
12498
+ Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.3ms)
12499
+ Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
12500
+ Completed 200 OK in 11ms (Views: 7.2ms | ActiveRecord: 0.0ms)
12501
+  (0.2ms) ROLLBACK
12502
+  (0.1ms) BEGIN
12503
+ Processing by SessionsController#failure as HTML
12504
+ Rendering /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application
12505
+ Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms)
12506
+ Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
12507
+ Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)
12508
+  (0.1ms) ROLLBACK
12509
+  (0.1ms) BEGIN
12510
+ Processing by SessionsController#destroy as HTML
12511
+ Redirected to http://test.host/signed_out
12512
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
12513
+  (0.1ms) ROLLBACK
12514
+  (0.1ms) BEGIN
12515
+ Processing by SessionsController#destroy as HTML
12516
+ Redirected to http://test.host/
12517
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
12518
+  (0.1ms) ROLLBACK
12519
+  (0.1ms) BEGIN
12520
+  (0.1ms) ROLLBACK
12521
+  (0.0ms) BEGIN
12522
+  (0.1ms) ROLLBACK
12523
+  (0.0ms) BEGIN
12524
+  (0.1ms) ROLLBACK
12525
+  (0.1ms) BEGIN
12526
+  (0.1ms) ROLLBACK
12527
+  (0.0ms) BEGIN
12528
+  (0.1ms) ROLLBACK
12529
+  (0.1ms) BEGIN
12530
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]
12531
+  (0.2ms) SAVEPOINT active_record_1
12532
+ 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]]
12533
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12534
+  (0.1ms) SAVEPOINT active_record_1
12535
+ 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]]
12536
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12537
+ Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]
12538
+  (0.1ms) ROLLBACK
12539
+  (0.1ms) BEGIN
12540
+  (0.2ms) ROLLBACK
12541
+  (0.1ms) BEGIN
12542
+  (0.1ms) SAVEPOINT active_record_1
12543
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
12544
+ 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]]
12545
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12546
+  (0.1ms) SAVEPOINT active_record_1
12547
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
12548
+ 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]]
12549
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12550
+ 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]]
12551
+  (0.1ms) SAVEPOINT active_record_1
12552
+ 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]]
12553
+ 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]]
12554
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12555
+  (0.1ms) ROLLBACK
12556
+  (0.1ms) BEGIN
12557
+  (0.1ms) SAVEPOINT active_record_1
12558
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
12559
+ 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]]
12560
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12561
+  (0.1ms) SAVEPOINT active_record_1
12562
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
12563
+ 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]]
12564
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12565
+ 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]]
12566
+  (0.1ms) SAVEPOINT active_record_1
12567
+ 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]]
12568
+ 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]]
12569
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12570
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 8], ["LIMIT", 1]]
12571
+  (0.1ms) ROLLBACK
12572
+  (0.1ms) BEGIN
12573
+  (0.1ms) SAVEPOINT active_record_1
12574
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
12575
+ 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]]
12576
+  (0.2ms) RELEASE SAVEPOINT active_record_1
12577
+  (0.1ms) SAVEPOINT active_record_1
12578
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
12579
+ 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]]
12580
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12581
+ 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]]
12582
+  (0.1ms) SAVEPOINT active_record_1
12583
+ 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]]
12584
+ 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]]
12585
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12586
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 10], ["LIMIT", 1]]
12587
+  (0.1ms) ROLLBACK
12588
+  (0.1ms) BEGIN
12589
+  (0.1ms) SAVEPOINT active_record_1
12590
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
12591
+ 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]]
12592
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12593
+  (0.3ms) SELECT COUNT(*) FROM "accounts"
12594
+ 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]]
12595
+  (0.1ms) SAVEPOINT active_record_1
12596
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
12597
+ 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"]]
12598
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12599
+  (0.2ms) SELECT COUNT(*) FROM "accounts"
12600
+  (0.1ms) ROLLBACK
12601
+  (0.1ms) BEGIN
12602
+  (0.1ms) SAVEPOINT active_record_1
12603
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
12604
+ 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]]
12605
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12606
+ 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]]
12607
+  (0.1ms) SAVEPOINT active_record_1
12608
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
12609
+ 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"]]
12610
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12611
+  (0.1ms) ROLLBACK
12612
+  (0.1ms) BEGIN
12613
+  (0.1ms) SAVEPOINT active_record_1
12614
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
12615
+ 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]]
12616
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12617
+ 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]]
12618
+  (0.1ms) SAVEPOINT active_record_1
12619
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
12620
+ 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"]]
12621
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12622
+  (0.1ms) ROLLBACK
12623
+  (0.1ms) BEGIN
12624
+  (0.1ms) SAVEPOINT active_record_1
12625
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
12626
+ 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]]
12627
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12628
+ 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]]
12629
+  (0.1ms) SAVEPOINT active_record_1
12630
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
12631
+ 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"]]
12632
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12633
+  (0.1ms) ROLLBACK
12634
+  (0.1ms) BEGIN
12635
+ Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
12636
+ 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"]]
12637
+  (0.4ms) COMMIT
12638
+  (0.1ms) BEGIN
12639
+ 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]]
12640
+ 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]]
12641
+  (0.5ms) COMMIT
12642
+ Account Load (0.3ms) SELECT "accounts".* FROM "accounts"
12643
+  (0.1ms) BEGIN
12644
+ SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 19]]
12645
+  (0.4ms) COMMIT
12646
+  (0.1ms) BEGIN
12647
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
12648
+ 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"]]
12649
+  (0.4ms) COMMIT
12650
+  (0.1ms) BEGIN
12651
+  (0.1ms) BEGIN
12652
+ 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]]
12653
+ 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]]
12654
+  (0.3ms) COMMIT
12655
+  (0.1ms) ROLLBACK
12656
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 20], ["LIMIT", 1]]
12657
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts"
12658
+  (0.1ms) BEGIN
12659
+ SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 20]]
12660
+  (0.3ms) COMMIT
12661
+  (0.1ms) BEGIN
12662
+  (0.1ms) SAVEPOINT active_record_1
12663
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
12664
+ 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"]]
12665
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12666
+  (0.1ms) ROLLBACK
12667
+  (0.1ms) BEGIN
12668
+  (0.1ms) SAVEPOINT active_record_1
12669
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]]
12670
+ 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"]]
12671
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12672
+  (0.1ms) SAVEPOINT active_record_1
12673
+ 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]]
12674
+ 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]]
12675
+  (0.2ms) RELEASE SAVEPOINT active_record_1
12676
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 22], ["LIMIT", 1]]
12677
+  (0.1ms) ROLLBACK
12678
+  (0.1ms) BEGIN
12679
+  (0.3ms) SAVEPOINT active_record_1
12680
+ Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
12681
+ 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]]
12682
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12683
+  (0.1ms) SAVEPOINT active_record_1
12684
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
12685
+ 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]]
12686
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12687
+ 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]]
12688
+  (0.1ms) SAVEPOINT active_record_1
12689
+ 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]]
12690
+ 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]]
12691
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12692
+  (0.1ms) ROLLBACK
12693
+  (0.1ms) BEGIN
12694
+  (0.1ms) SAVEPOINT active_record_1
12695
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
12696
+ 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]]
12697
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12698
+  (0.1ms) SAVEPOINT active_record_1
12699
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
12700
+ 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]]
12701
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12702
+ 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]]
12703
+  (0.1ms) SAVEPOINT active_record_1
12704
+ 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]]
12705
+ 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]]
12706
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12707
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 4], ["LIMIT", 1]]
12708
+  (0.1ms) ROLLBACK
12709
+  (0.1ms) BEGIN
12710
+  (0.1ms) SAVEPOINT active_record_1
12711
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
12712
+ 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]]
12713
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12714
+  (0.1ms) SAVEPOINT active_record_1
12715
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
12716
+ 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]]
12717
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12718
+ 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]]
12719
+  (0.2ms) SAVEPOINT active_record_1
12720
+ 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]]
12721
+ 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]]
12722
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12723
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 6], ["LIMIT", 1]]
12724
+  (0.1ms) ROLLBACK
12725
+  (0.1ms) BEGIN
12726
+  (0.1ms) SAVEPOINT active_record_1
12727
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
12728
+ 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]]
12729
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12730
+  (0.3ms) SELECT COUNT(*) FROM "accounts"
12731
+ 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]]
12732
+  (0.1ms) SAVEPOINT active_record_1
12733
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
12734
+ 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"]]
12735
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12736
+  (0.2ms) SELECT COUNT(*) FROM "accounts"
12737
+  (0.1ms) ROLLBACK
12738
+  (0.1ms) BEGIN
12739
+  (0.2ms) SAVEPOINT active_record_1
12740
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
12741
+ 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]]
12742
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12743
+ 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]]
12744
+  (0.1ms) SAVEPOINT active_record_1
12745
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
12746
+ 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"]]
12747
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12748
+  (0.1ms) ROLLBACK
12749
+  (0.1ms) BEGIN
12750
+  (0.1ms) SAVEPOINT active_record_1
12751
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
12752
+ 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]]
12753
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12754
+ 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]]
12755
+  (0.1ms) SAVEPOINT active_record_1
12756
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
12757
+ 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"]]
12758
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12759
+  (0.1ms) ROLLBACK
12760
+  (0.1ms) BEGIN
12761
+  (0.1ms) SAVEPOINT active_record_1
12762
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]]
12763
+ 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]]
12764
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12765
+ 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]]
12766
+  (0.1ms) SAVEPOINT active_record_1
12767
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
12768
+ 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"]]
12769
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12770
+  (0.2ms) ROLLBACK
12771
+  (0.1ms) BEGIN
12772
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]
12773
+  (0.2ms) SAVEPOINT active_record_1
12774
+ 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"]]
12775
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12776
+  (0.1ms) SAVEPOINT active_record_1
12777
+ 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]]
12778
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12779
+ Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]
12780
+  (0.2ms) ROLLBACK
12781
+  (0.1ms) BEGIN
12782
+  (0.2ms) ROLLBACK
12783
+  (0.1ms) BEGIN
12784
+  (0.1ms) SAVEPOINT active_record_1
12785
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]]
12786
+ 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"]]
12787
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12788
+  (0.1ms) SAVEPOINT active_record_1
12789
+ 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]]
12790
+ 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]]
12791
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12792
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 16], ["LIMIT", 1]]
12793
+  (0.1ms) ROLLBACK
12794
+  (0.1ms) BEGIN
12795
+  (0.1ms) SAVEPOINT active_record_1
12796
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
12797
+ 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"]]
12798
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12799
+  (0.1ms) ROLLBACK
12800
+  (0.1ms) BEGIN
12801
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
12802
+ 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"]]
12803
+  (2.0ms) COMMIT
12804
+  (0.1ms) BEGIN
12805
+ 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]]
12806
+ 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]]
12807
+  (0.4ms) COMMIT
12808
+ Account Load (0.4ms) SELECT "accounts".* FROM "accounts"
12809
+  (0.1ms) BEGIN
12810
+ SQL (0.3ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 18]]
12811
+  (0.4ms) COMMIT
12812
+  (0.1ms) BEGIN
12813
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
12814
+ 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"]]
12815
+  (0.4ms) COMMIT
12816
+  (0.1ms) BEGIN
12817
+  (0.1ms) BEGIN
12818
+ 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]]
12819
+ 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]]
12820
+  (0.5ms) COMMIT
12821
+  (0.1ms) ROLLBACK
12822
+ Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 19], ["LIMIT", 1]]
12823
+ Account Load (0.2ms) SELECT "accounts".* FROM "accounts"
12824
+  (0.1ms) BEGIN
12825
+ SQL (0.2ms) DELETE FROM "accounts" WHERE "accounts"."id" = $1 [["id", 19]]
12826
+  (0.4ms) COMMIT
12827
+  (0.1ms) BEGIN
12828
+ Processing by SessionsController#destroy as HTML
12829
+ Redirected to http://test.host/signed_out
12830
+ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
12831
+  (0.1ms) ROLLBACK
12832
+  (0.1ms) BEGIN
12833
+ Processing by SessionsController#destroy as HTML
12834
+ Redirected to http://test.host/
12835
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
12836
+  (0.1ms) ROLLBACK
12837
+  (0.1ms) BEGIN
12838
+ Processing by SessionsController#create as HTML
12839
+ Parameters: {"provider"=>"bookingsync"}
12840
+ 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]]
12841
+  (0.1ms) SAVEPOINT active_record_1
12842
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
12843
+ 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"]]
12844
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12845
+ Redirected to http://test.host/
12846
+ Completed 302 Found in 3ms (ActiveRecord: 0.9ms)
12847
+  (0.1ms) ROLLBACK
12848
+  (0.1ms) BEGIN
12849
+ Processing by SessionsController#create as HTML
12850
+ Parameters: {"provider"=>"bookingsync"}
12851
+ 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]]
12852
+  (0.1ms) SAVEPOINT active_record_1
12853
+ Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
12854
+ 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"]]
12855
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12856
+ Redirected to http://test.host/admin
12857
+ Completed 302 Found in 4ms (ActiveRecord: 1.1ms)
12858
+  (0.1ms) ROLLBACK
12859
+  (0.1ms) BEGIN
12860
+ Processing by SessionsController#create as HTML
12861
+ Parameters: {"provider"=>"bookingsync"}
12862
+ 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]]
12863
+  (0.2ms) SAVEPOINT active_record_1
12864
+ Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]
12865
+ 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"]]
12866
+  (0.1ms) RELEASE SAVEPOINT active_record_1
12867
+ Redirected to http://test.host/
12868
+ Completed 302 Found in 5ms (ActiveRecord: 1.1ms)
12869
+  (0.1ms) ROLLBACK
12870
+  (0.1ms) BEGIN
12871
+ Processing by SessionsController#failure as HTML
12872
+ Rendering /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application
12873
+ Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms)
12874
+ Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
12875
+ Completed 200 OK in 15ms (Views: 11.1ms | ActiveRecord: 0.0ms)
12876
+  (0.2ms) ROLLBACK
12877
+  (0.1ms) BEGIN
12878
+ Processing by SessionsController#failure as HTML
12879
+ Rendering /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application
12880
+ Rendered /Users/seb/work/websites/bookingsync/gems/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms)
12881
+ Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
12882
+ Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)
12883
+  (0.1ms) ROLLBACK
12884
+  (0.1ms) BEGIN
12885
+  (0.1ms) ROLLBACK
12886
+  (0.1ms) BEGIN
12887
+  (0.1ms) ROLLBACK
12888
+  (0.1ms) BEGIN
12889
+  (0.1ms) ROLLBACK
12890
+  (0.1ms) BEGIN
12891
+  (0.1ms) ROLLBACK
12892
+  (0.1ms) BEGIN
12893
+  (0.1ms) ROLLBACK
12894
+  (0.1ms) BEGIN
12895
+ Processing by AuthenticatedController#index as HTML
12896
+ Redirected to http://test.host/auth/bookingsync/?account_id=
12897
+ Filter chain halted as :authenticate_account! rendered or redirected
12898
+ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
12899
+  (0.1ms) ROLLBACK
12900
+  (0.1ms) BEGIN
12901
+ Processing by AuthenticatedController#index as HTML
12902
+ Rendering text template
12903
+ Rendered text template (0.0ms)
12904
+ Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
12905
+ Filter chain halted as :authenticate_account! rendered or redirected
12906
+ Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.0ms)
12907
+  (0.2ms) ROLLBACK
12908
+  (0.1ms) BEGIN
12909
+ Processing by AuthenticatedController#index as JS
12910
+ Rendering text template
12911
+ Rendered text template (0.0ms)
12912
+ Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
12913
+ Filter chain halted as :authenticate_account! rendered or redirected
12914
+ Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)
12915
+  (0.1ms) ROLLBACK
12916
+  (0.1ms) BEGIN
12917
+ Processing by AuthenticatedController#index as JS
12918
+ Rendering text template
12919
+ Rendered text template (0.0ms)
12920
+ Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.
12921
+ Filter chain halted as :authenticate_account! rendered or redirected
12922
+ Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)
12923
+  (0.1ms) ROLLBACK