test/dummy/log/test.log in oauth_service-0.0.1 vs test/dummy/log/test.log in oauth_service-0.0.2

- old
+ new

@@ -856,5 +856,6951 @@  (0.1ms) begin transaction ------------------------------------ OauthServiceProviderTest: test_truth ------------------------------------  (0.2ms) rollback transaction +  (125.3ms) CREATE TABLE "urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "url_pattern" varchar, "name" varchar, "http_method" varchar)  +  (99.1ms) CREATE TABLE "user_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar) +  (0.2ms) select sqlite_version(*) +  (109.0ms) CREATE INDEX "index_user_groups_on_name" ON "user_groups" ("name") +  (106.7ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "api_code" varchar)  +  (106.6ms) CREATE INDEX "index_users_on_name" ON "users" ("name") +  (106.6ms) CREATE TABLE "users_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_group_id" integer, "user_id" integer)  +  (116.1ms) CREATE TABLE "users_urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "users_group_id" integer, "url_id" integer) +  (132.3ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)  +  (106.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version") +  (0.3ms) SELECT version FROM "schema_migrations" +  (106.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20160514163909') + ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.2ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.1ms) rollback transaction +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.0ms) rollback transaction +  (0.0ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.0ms) rollback transaction +  (0.0ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.1ms) rollback transaction +  (0.0ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +Started GET "/localhost:3000/login" for 127.0.0.1 at 2016-05-15 01:07:29 +0300 +  (0.1ms) rollback transaction +  (0.0ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.0ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +Started GET "/localhost:3000/login" for 127.0.0.1 at 2016-05-15 01:08:19 +0300 +  (0.1ms) rollback transaction +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.0ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +Started GET "/login" for 127.0.0.1 at 2016-05-15 01:08:43 +0300 +Processing by LoginController#index as HTML + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] +Completed 500 Internal Server Error in 9ms (ActiveRecord: 0.2ms) +  (0.0ms) rollback transaction +  (0.0ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.0ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +Started GET "/login" for 127.0.0.1 at 2016-05-15 01:09:37 +0300 +Processing by LoginController#index as HTML + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] +Completed 500 Internal Server Error in 10ms (ActiveRecord: 0.2ms) +  (0.0ms) rollback transaction +  (0.0ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.0ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +Started GET "/login" for 127.0.0.1 at 2016-05-15 01:10:24 +0300 +Processing by LoginController#index as HTML + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] +Completed 500 Internal Server Error in 9ms (ActiveRecord: 0.2ms) +  (0.0ms) rollback transaction +  (0.0ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.0ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"], ["id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("id", "name") VALUES (?, ?) [["id", 1], ["name", "Guest"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("id", "user_id", "user_group_id") VALUES (?, ?, ?) [["id", 1], ["user_id", 1], ["user_group_id", 1]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 1], ["url_id", 1], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 2], ["url_id", 2], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 3]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +Started GET "/login" for 127.0.0.1 at 2016-05-15 01:10:49 +0300 +Processing by LoginController#index as HTML + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (1.9ms) +Completed 200 OK in 170ms (Views: 154.2ms | ActiveRecord: 0.3ms) +Started GET "/authorize?client_id=4ecb46d4824c4b3fb7bc69a1a34dcf4f&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Foauth%2Fyandex&scope=email+profile" for 127.0.0.1 at 2016-05-15 01:10:49 +0300 +  (0.4ms) rollback transaction +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.1ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"], ["id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("id", "name") VALUES (?, ?) [["id", 1], ["name", "Guest"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("id", "user_id", "user_group_id") VALUES (?, ?, ?) [["id", 1], ["user_id", 1], ["user_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 1], ["url_id", 1], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 2], ["url_id", 2], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 3]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +Started GET "/login" for 127.0.0.1 at 2016-05-15 01:13:15 +0300 +Processing by LoginController#index as HTML + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (2.0ms) +Completed 200 OK in 169ms (Views: 152.7ms | ActiveRecord: 0.3ms) +Started GET "/authorize?client_id=4ecb46d4824c4b3fb7bc69a1a34dcf4f&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Foauth%2Fyandex&scope=email+profile" for 127.0.0.1 at 2016-05-15 01:13:15 +0300 +  (0.2ms) rollback transaction +  (0.0ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.0ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 1], ["user_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +Started GET "/login" for 127.0.0.1 at 2016-05-15 01:18:42 +0300 +Processing by LoginController#index as HTML + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] +Completed 500 Internal Server Error in 3ms (ActiveRecord: 0.1ms) +  (0.1ms) rollback transaction +  (0.0ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.0ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"], ["id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("id", "name") VALUES (?, ?) [["id", 1], ["name", "Guest"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("id", "user_id", "user_group_id") VALUES (?, ?, ?) [["id", 1], ["user_id", 1], ["user_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 1], ["url_id", 1], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 2], ["url_id", 2], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 3]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +Started GET "/login" for 127.0.0.1 at 2016-05-15 01:18:58 +0300 +Processing by LoginController#index as HTML + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (2.0ms) +Completed 200 OK in 174ms (Views: 157.4ms | ActiveRecord: 0.3ms) +Started GET "/authorize?client_id=4ecb46d4824c4b3fb7bc69a1a34dcf4f&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Foauth%2Fyandex&scope=email+profile" for 127.0.0.1 at 2016-05-15 01:18:58 +0300 +  (0.2ms) rollback transaction +  (0.0ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.0ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"], ["id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("id", "name") VALUES (?, ?) [["id", 1], ["name", "Guest"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("id", "user_id", "user_group_id") VALUES (?, ?, ?) [["id", 1], ["user_id", 1], ["user_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 1], ["url_id", 1], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 2], ["url_id", 2], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 3]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +Started GET "/login" for 127.0.0.1 at 2016-05-15 01:19:11 +0300 +Processing by LoginController#index as HTML + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (2.1ms) +Completed 200 OK in 171ms (Views: 154.2ms | ActiveRecord: 0.3ms) +Started GET "/authorize?client_id=4ecb46d4824c4b3fb7bc69a1a34dcf4f&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Foauth%2Fyandex&scope=email+profile" for 127.0.0.1 at 2016-05-15 01:19:11 +0300 +  (0.1ms) rollback transaction +  (0.0ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.0ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.0ms) rollback transaction +  (0.0ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"], ["id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("id", "name") VALUES (?, ?) [["id", 1], ["name", "Guest"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("id", "user_id", "user_group_id") VALUES (?, ?, ?) [["id", 1], ["user_id", 1], ["user_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 1], ["url_id", 1], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 2], ["url_id", 2], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 3]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +Started GET "/login" for 127.0.0.1 at 2016-05-15 01:21:38 +0300 +Processing by LoginController#index as HTML + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (2.0ms) +Completed 200 OK in 170ms (Views: 153.4ms | ActiveRecord: 0.3ms) +Started GET "/o/oauth2/auth?client_id=24046466848-0lp2mda92adg6do67kr2d0frphbu5aqg.apps.googleusercontent.com&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Foauth%2Fgoogle&scope=email+profile" for 127.0.0.1 at 2016-05-15 01:21:38 +0300 +  (0.1ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"], ["id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("id", "name") VALUES (?, ?) [["id", 1], ["name", "Guest"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("id", "user_id", "user_group_id") VALUES (?, ?, ?) [["id", 1], ["user_id", 1], ["user_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 1], ["url_id", 1], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 2], ["url_id", 2], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 3]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +Started GET "/login" for 127.0.0.1 at 2016-05-15 01:23:15 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (2.0ms) +Completed 200 OK in 178ms (Views: 161.9ms | ActiveRecord: 0.3ms) +Started GET "/o/oauth2/auth?client_id=24046466848-0lp2mda92adg6do67kr2d0frphbu5aqg.apps.googleusercontent.com&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Foauth%2Fgoogle&scope=email+profile" for 127.0.0.1 at 2016-05-15 01:23:15 +0300 +  (0.2ms) rollback transaction +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.0ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"], ["id", 2]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("id", "name") VALUES (?, ?) [["id", 1], ["name", "Guest"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("id", "user_id", "user_group_id") VALUES (?, ?, ?) [["id", 1], ["user_id", 1], ["user_group_id", 1]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 1], ["url_id", 1], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 2], ["url_id", 2], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 3]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +Started GET "/login" for 127.0.0.1 at 2016-05-15 01:28:26 +0300 +Processing by LoginController#index as HTML + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (2.0ms) +Completed 200 OK in 168ms (Views: 151.9ms | ActiveRecord: 0.3ms) +Started GET "/authorize?client_id=4ecb46d4824c4b3fb7bc69a1a34dcf4f&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Foauth%2Fyandex&scope=email+profile" for 127.0.0.1 at 2016-05-15 01:28:26 +0300 +  (0.1ms) rollback transaction +  (0.0ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.0ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.3ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"], ["id", 1]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"], ["id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("id", "name") VALUES (?, ?) [["id", 1], ["name", "Guest"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("id", "user_id", "user_group_id") VALUES (?, ?, ?) [["id", 1], ["user_id", 1], ["user_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 1], ["url_id", 1], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 2], ["url_id", 2], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 3]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +Started GET "/login" for 127.0.0.1 at 2016-05-15 01:30:57 +0300 +Processing by LoginController#index as HTML + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (2.0ms) +Completed 200 OK in 166ms (Views: 149.7ms | ActiveRecord: 0.3ms) +Started GET "/authorize?client_id=4ecb46d4824c4b3fb7bc69a1a34dcf4f&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Foauth%2Fyandex&scope=email+profile" for 127.0.0.1 at 2016-05-15 01:30:57 +0300 +  (0.1ms) rollback transaction +  (0.0ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.0ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.0ms) rollback transaction +  (0.0ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"], ["id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("id", "name") VALUES (?, ?) [["id", 1], ["name", "Guest"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("id", "user_id", "user_group_id") VALUES (?, ?, ?) [["id", 1], ["user_id", 1], ["user_group_id", 1]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 1], ["url_id", 1], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 2], ["url_id", 2], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 3]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +Started GET "/login/" for 127.0.0.1 at 2016-05-15 01:31:26 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (1.9ms) +Completed 200 OK in 166ms (Views: 149.9ms | ActiveRecord: 0.3ms) +Started GET "/authorize?client_id=4ecb46d4824c4b3fb7bc69a1a34dcf4f&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Foauth%2Fyandex&scope=email+profile" for 127.0.0.1 at 2016-05-15 01:31:26 +0300 +  (0.2ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"], ["id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("id", "name") VALUES (?, ?) [["id", 1], ["name", "Guest"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("id", "user_id", "user_group_id") VALUES (?, ?, ?) [["id", 1], ["user_id", 1], ["user_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 1], ["url_id", 1], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 2], ["url_id", 2], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 3]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +Started GET "/" for 127.0.0.1 at 2016-05-15 01:31:37 +0300 +  (0.2ms) rollback transaction +  (0.0ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.0ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"], ["id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("id", "name") VALUES (?, ?) [["id", 1], ["name", "Guest"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("id", "user_id", "user_group_id") VALUES (?, ?, ?) [["id", 1], ["user_id", 1], ["user_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 1], ["url_id", 1], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 2], ["url_id", 2], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 3]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Started GET "/welcome" for 127.0.0.1 at 2016-05-15 01:31:52 +0300 +  (0.1ms) rollback transaction +  (0.0ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.0ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.0ms) rollback transaction +  (0.0ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"], ["id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("id", "name") VALUES (?, ?) [["id", 1], ["name", "Guest"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("id", "user_id", "user_group_id") VALUES (?, ?, ?) [["id", 1], ["user_id", 1], ["user_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 1], ["url_id", 1], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 2], ["url_id", 2], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 3]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +Started GET "/oauth/google" for 127.0.0.1 at 2016-05-15 01:32:09 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"provider_name"=>"google"} + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 +Completed 400 Bad Request in 136ms (Views: 0.4ms | ActiveRecord: 0.3ms) +  (0.3ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.0ms) rollback transaction +  (0.0ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"], ["id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("id", "name") VALUES (?, ?) [["id", 1], ["name", "Guest"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("id", "user_id", "user_group_id") VALUES (?, ?, ?) [["id", 1], ["user_id", 1], ["user_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 1], ["url_id", 1], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 2], ["url_id", 2], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 3]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +Started GET "/login" for 127.0.0.1 at 2016-05-15 01:32:31 +0300 +Processing by LoginController#index as HTML + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (1.9ms) +Completed 200 OK in 163ms (Views: 146.3ms | ActiveRecord: 0.3ms) +Started GET "/authorize?client_id=4ecb46d4824c4b3fb7bc69a1a34dcf4f&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Foauth%2Fyandex&scope=email+profile" for 127.0.0.1 at 2016-05-15 01:32:32 +0300 +  (0.1ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) rollback transaction +  (0.0ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"], ["id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("id", "name") VALUES (?, ?) [["id", 1], ["name", "Guest"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("id", "user_id", "user_group_id") VALUES (?, ?, ?) [["id", 1], ["user_id", 1], ["user_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 1], ["url_id", 1], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 2], ["url_id", 2], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 3]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.2ms) rollback transaction +  (0.0ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"], ["id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("id", "name") VALUES (?, ?) [["id", 1], ["name", "Guest"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("id", "user_id", "user_group_id") VALUES (?, ?, ?) [["id", 1], ["user_id", 1], ["user_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 1], ["url_id", 1], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 2], ["url_id", 2], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 3]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +Started GET "/login" for 127.0.0.1 at 2016-05-15 01:36:16 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] +Completed 500 Internal Server Error in 4ms (ActiveRecord: 0.3ms) +  (0.4ms) rollback transaction +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +Started GET "/login" for 127.0.0.1 at 2016-05-15 01:36:26 +0300 +Processing by LoginController#index as HTML + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] +Completed 500 Internal Server Error in 2ms (ActiveRecord: 0.4ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"], ["id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("id", "name") VALUES (?, ?) [["id", 1], ["name", "Guest"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("id", "user_id", "user_group_id") VALUES (?, ?, ?) [["id", 1], ["user_id", 1], ["user_group_id", 1]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 1], ["url_id", 1], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 2], ["url_id", 2], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 3]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 + User Load (0.1ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 01:36:56 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] +Completed 500 Internal Server Error in 4ms (ActiveRecord: 0.3ms) +  (0.2ms) rollback transaction +  (0.0ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"], ["id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("id", "name") VALUES (?, ?) [["id", 1], ["name", "Guest"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("id", "user_id", "user_group_id") VALUES (?, ?, ?) [["id", 1], ["user_id", 1], ["user_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 1], ["url_id", 1], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 2], ["url_id", 2], ["users_group_id", 1]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 3]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 + User Load (0.1ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 01:38:21 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] +Completed 500 Internal Server Error in 4ms (ActiveRecord: 0.3ms) +  (0.2ms) rollback transaction +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"], ["id", 1]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"], ["id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("id", "name") VALUES (?, ?) [["id", 1], ["name", "Guest"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("id", "user_id", "user_group_id") VALUES (?, ?, ?) [["id", 1], ["user_id", 1], ["user_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 1], ["url_id", 1], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 2], ["url_id", 2], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 3]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 + User Load (0.1ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 01:39:06 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] +Completed 500 Internal Server Error in 6ms (ActiveRecord: 0.4ms) +  (0.2ms) rollback transaction +  (0.0ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"], ["id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("id", "name") VALUES (?, ?) [["id", 1], ["name", "Guest"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("id", "user_id", "user_group_id") VALUES (?, ?, ?) [["id", 1], ["user_id", 1], ["user_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 1], ["url_id", 1], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 2], ["url_id", 2], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 3]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 + User Load (0.1ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 01:40:58 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] +Completed 500 Internal Server Error in 4ms (ActiveRecord: 0.3ms) +  (0.2ms) rollback transaction +  (0.0ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"], ["id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("id", "name") VALUES (?, ?) [["id", 1], ["name", "Guest"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("id", "user_id", "user_group_id") VALUES (?, ?, ?) [["id", 1], ["user_id", 1], ["user_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 1], ["url_id", 1], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 2], ["url_id", 2], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 3]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 + User Load (0.1ms) SELECT "users".* FROM "users" + User Load (0.1ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 01:41:37 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] +Completed 500 Internal Server Error in 4ms (ActiveRecord: 0.3ms) +  (0.2ms) rollback transaction +  (0.0ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.3ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"], ["id", 1]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"], ["id", 2]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "user_groups" ("id", "name") VALUES (?, ?) [["id", 1], ["name", "Guest"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("id", "user_id", "user_group_id") VALUES (?, ?, ?) [["id", 1], ["user_id", 1], ["user_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 1], ["url_id", 1], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 2], ["url_id", 2], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 3]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + User Load (0.1ms) SELECT "users".* FROM "users" + User Load (0.1ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 01:42:09 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] +Completed 500 Internal Server Error in 4ms (ActiveRecord: 0.3ms) +  (0.2ms) rollback transaction +  (0.0ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"], ["id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("id", "name") VALUES (?, ?) [["id", 1], ["name", "Guest"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("id", "user_id", "user_group_id") VALUES (?, ?, ?) [["id", 1], ["user_id", 1], ["user_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 1], ["url_id", 1], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 2], ["url_id", 2], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 3]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 + User Load (0.1ms) SELECT "users".* FROM "users" + User Load (0.1ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 01:44:43 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] +Completed 500 Internal Server Error in 4ms (ActiveRecord: 0.3ms) +  (0.2ms) rollback transaction +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +Started GET "/" for 127.0.0.1 at 2016-05-15 01:44:47 +0300 +Started GET "/index" for 127.0.0.1 at 2016-05-15 01:44:51 +0300 +Started GET "/d" for 127.0.0.1 at 2016-05-15 01:44:55 +0300 +Processing by DController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] +Completed 500 Internal Server Error in 1ms (ActiveRecord: 0.3ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"], ["id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("id", "name") VALUES (?, ?) [["id", 1], ["name", "Guest"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("id", "user_id", "user_group_id") VALUES (?, ?, ?) [["id", 1], ["user_id", 1], ["user_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 1], ["url_id", 1], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 2], ["url_id", 2], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 3]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 + User Load (0.1ms) SELECT "users".* FROM "users" + User Load (0.1ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 01:45:53 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] +Completed 500 Internal Server Error in 4ms (ActiveRecord: 0.2ms) +  (0.3ms) rollback transaction +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"], ["id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("id", "name") VALUES (?, ?) [["id", 1], ["name", "Guest"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("id", "user_id", "user_group_id") VALUES (?, ?, ?) [["id", 1], ["user_id", 1], ["user_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 1], ["url_id", 1], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 2], ["url_id", 2], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 3]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + User Load (0.1ms) SELECT "users".* FROM "users" + User Load (0.1ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 01:46:08 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] +Completed 500 Internal Server Error in 4ms (ActiveRecord: 0.3ms) +  (0.2ms) rollback transaction +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"], ["id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("id", "name") VALUES (?, ?) [["id", 1], ["name", "Guest"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("id", "user_id", "user_group_id") VALUES (?, ?, ?) [["id", 1], ["user_id", 1], ["user_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 1], ["url_id", 1], ["users_group_id", 1]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 2], ["url_id", 2], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 3]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 + User Load (0.1ms) SELECT "users".* FROM "users" + User Load (0.1ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 01:47:19 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] +Completed 500 Internal Server Error in 5ms (ActiveRecord: 0.3ms) +  (0.4ms) rollback transaction +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"], ["id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("id", "name") VALUES (?, ?) [["id", 1], ["name", "Guest"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("id", "user_id", "user_group_id") VALUES (?, ?, ?) [["id", 1], ["user_id", 1], ["user_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 1], ["url_id", 1], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 2], ["url_id", 2], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 3]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 + User Load (0.1ms) SELECT "users".* FROM "users" + User Load (0.1ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 01:47:52 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] +Completed 500 Internal Server Error in 4ms (ActiveRecord: 0.3ms) +  (0.3ms) rollback transaction +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"], ["id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("id", "name") VALUES (?, ?) [["id", 1], ["name", "Guest"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("id", "user_id", "user_group_id") VALUES (?, ?, ?) [["id", 1], ["user_id", 1], ["user_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 1], ["url_id", 1], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 2], ["url_id", 2], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 3]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 + User Load (0.1ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 01:48:15 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] +Completed 500 Internal Server Error in 4ms (ActiveRecord: 0.3ms) +  (0.2ms) rollback transaction +  (0.0ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"], ["id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("id", "name") VALUES (?, ?) [["id", 1], ["name", "Guest"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("id", "user_id", "user_group_id") VALUES (?, ?, ?) [["id", 1], ["user_id", 1], ["user_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 1], ["url_id", 1], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 2], ["url_id", 2], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 3]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 + User Load (0.1ms) SELECT "users".* FROM "users" + User Load (0.1ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 01:48:53 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] +Completed 500 Internal Server Error in 4ms (ActiveRecord: 0.3ms) +  (0.3ms) rollback transaction +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ + User Load (0.1ms) SELECT "users".* FROM "users" +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"], ["id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("id", "name") VALUES (?, ?) [["id", 1], ["name", "Guest"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("id", "user_id", "user_group_id") VALUES (?, ?, ?) [["id", 1], ["user_id", 1], ["user_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 1], ["url_id", 1], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 2], ["url_id", 2], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 3]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 + User Load (0.1ms) SELECT "users".* FROM "users" + User Load (0.1ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 01:52:53 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] +Completed 500 Internal Server Error in 5ms (ActiveRecord: 0.3ms) +  (0.2ms) rollback transaction +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ + User Load (0.1ms) SELECT "users".* FROM "users" +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"], ["id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"], ["id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("id", "name") VALUES (?, ?) [["id", 1], ["name", "Guest"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("id", "user_id", "user_group_id") VALUES (?, ?, ?) [["id", 1], ["user_id", 1], ["user_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 1], ["url_id", 1], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.0ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 2], ["url_id", 2], ["users_group_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 3]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 + User Load (0.1ms) SELECT "users".* FROM "users" + User Load (0.1ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 01:56:39 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] +Completed 500 Internal Server Error in 4ms (ActiveRecord: 0.3ms) +  (0.2ms) rollback transaction +  (0.0ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]] +  (111.2ms) commit transaction +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"], ["id", 1]] +  (103.3ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"], ["id", 2]] +  (105.5ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("id", "name") VALUES (?, ?) [["id", 1], ["name", "Guest"]] +  (105.5ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("id", "user_id", "user_group_id") VALUES (?, ?, ?) [["id", 1], ["user_id", 1], ["user_group_id", 1]] +  (90.9ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 1], ["url_id", 1], ["users_group_id", 1]] +  (95.6ms) commit transaction +  (0.3ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 2], ["url_id", 2], ["users_group_id", 1]] +  (96.3ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (104.4ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (112.3ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]] +  (113.4ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (104.1ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 3]] +  (113.2ms) commit transaction + User Load (0.3ms) SELECT "users".* FROM "users" + User Load (0.3ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 01:58:06 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.4ms) +Completed 200 OK in 215ms (Views: 195.2ms | ActiveRecord: 0.7ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 01:58:07 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 01:58:07 +0300 + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]] +  (0.0ms) rollback transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (110.2ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (119.1ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 3], ["user_group_id", 3]] +  (123.6ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (117.8ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 4]] +  (126.4ms) commit transaction + User Load (0.4ms) SELECT "users".* FROM "users" + User Load (0.2ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 01:59:27 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.5ms) +Completed 200 OK in 247ms (Views: 230.1ms | ActiveRecord: 0.6ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 01:59:27 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 01:59:27 +0300 + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (125.0ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (88.9ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 4], ["user_group_id", 4]] +  (91.7ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (128.7ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 5]] +  (126.9ms) commit transaction + User Load (0.4ms) SELECT "users".* FROM "users" + User Load (0.4ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 02:00:53 +0300 +Processing by LoginController#index as HTML + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (4.9ms) +Completed 200 OK in 237ms (Views: 205.6ms | ActiveRecord: 0.8ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 02:00:53 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 02:00:53 +0300 + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (127.6ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (105.7ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 5], ["user_group_id", 5]] +  (109.0ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (100.4ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 6]] +  (110.1ms) commit transaction + User Load (0.4ms) SELECT "users".* FROM "users" + User Load (0.3ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 02:01:37 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.4ms) +Completed 200 OK in 223ms (Views: 202.7ms | ActiveRecord: 0.7ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 02:01:37 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 02:01:37 +0300 + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (131.5ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (114.6ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 6], ["user_group_id", 6]] +  (90.0ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (82.5ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 7]] +  (105.8ms) commit transaction + User Load (0.4ms) SELECT "users".* FROM "users" + User Load (0.4ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 02:02:48 +0300 +Processing by LoginController#index as HTML + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.2ms) +Completed 200 OK in 263ms (Views: 238.8ms | ActiveRecord: 0.8ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 02:02:48 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 02:02:48 +0300 + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (114.2ms) commit transaction +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (105.9ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 7], ["user_group_id", 7]] +  (108.0ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (108.7ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 8]] +  (111.1ms) commit transaction + User Load (0.4ms) SELECT "users".* FROM "users" + User Load (0.3ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 02:03:40 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.8ms) +Completed 200 OK in 227ms (Views: 200.6ms | ActiveRecord: 0.8ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 02:03:40 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 02:03:40 +0300 +Started GET "/oauth/yandex?code=6886944" for 127.0.0.1 at 2016-05-15 02:03:42 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"6886944", "provider_name"=>"yandex"} + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.6ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.1ms) begin transaction + SQL (0.4ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "8bb4fb1c-9fb5-4d1a-a9cb-e0d0fac3553d"], ["id", 2]] +  (108.8ms) commit transaction +Completed 200 OK in 303ms (Views: 0.6ms | ActiveRecord: 110.3ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (113.6ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (101.4ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 8], ["user_group_id", 8]] +  (136.9ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (98.5ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 9]] +  (110.6ms) commit transaction + User Load (0.3ms) SELECT "users".* FROM "users" + User Load (0.3ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 02:04:42 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.2ms) +Completed 200 OK in 220ms (Views: 200.6ms | ActiveRecord: 0.6ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 02:04:42 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 02:04:42 +0300 +Started GET "/oauth/yandex?code=7722388" for 127.0.0.1 at 2016-05-15 02:04:45 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"7722388", "provider_name"=>"yandex"} + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.7ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.1ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "20fc1453-b269-47fe-908d-1a2b8b00beca"], ["id", 2]] +  (248.9ms) commit transaction +Completed 200 OK in 445ms (Views: 0.5ms | ActiveRecord: 250.9ms) +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.0ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (118.9ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (89.9ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 9], ["user_group_id", 9]] +  (90.4ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (99.6ms) commit transaction +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 10]] +  (106.2ms) commit transaction + User Load (0.4ms) SELECT "users".* FROM "users" + User Load (0.4ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 02:07:02 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (4.4ms) +Completed 200 OK in 254ms (Views: 233.7ms | ActiveRecord: 0.6ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 02:07:02 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 02:07:02 +0300 +Started GET "/oauth/yandex?code=9767581" for 127.0.0.1 at 2016-05-15 02:07:04 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"9767581", "provider_name"=>"yandex"} + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.8ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.1ms) begin transaction + SQL (0.4ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "2860c0c7-3240-41e9-80a7-ea5d3fee0e3e"], ["id", 2]] +  (105.1ms) commit transaction +Completed 200 OK in 274ms (Views: 0.4ms | ActiveRecord: 106.9ms) +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ + User Load (0.2ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 02:07:05 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (0.3ms) +Completed 200 OK in 4ms (Views: 1.5ms | ActiveRecord: 0.4ms) +Started GET "/oauth/yandex?code=8927795" for 127.0.0.1 at 2016-05-15 02:07:05 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"8927795", "provider_name"=>"yandex"} + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.3ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.1ms) begin transaction + SQL (0.4ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "62299889-cf9f-4829-930a-e2502eaafa59"], ["id", 2]] +  (114.0ms) commit transaction +Completed 200 OK in 300ms (Views: 0.4ms | ActiveRecord: 115.2ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.0ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (125.9ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (113.9ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 10], ["user_group_id", 10]] +  (123.3ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (98.1ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 11]] +  (98.7ms) commit transaction + User Load (0.4ms) SELECT "users".* FROM "users" + User Load (0.3ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 02:10:24 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.1ms) +Completed 200 OK in 220ms (Views: 198.7ms | ActiveRecord: 0.7ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 02:10:25 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 02:10:25 +0300 +Started GET "/oauth/yandex?code=8831039" for 127.0.0.1 at 2016-05-15 02:10:27 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"8831039", "provider_name"=>"yandex"} + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.8ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.6ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "cc02b7b9-4a49-4710-b97d-2c22d3b80383"], ["id", 2]] +  (88.8ms) commit transaction +Completed 200 OK in 561ms (Views: 0.5ms | ActiveRecord: 90.9ms) +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ + User Load (0.2ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 02:10:28 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (0.2ms) +Completed 200 OK in 4ms (Views: 1.3ms | ActiveRecord: 0.4ms) +Started GET "/oauth/yandex?code=9897642" for 127.0.0.1 at 2016-05-15 02:10:28 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"9897642", "provider_name"=>"yandex"} + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.6ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.1ms) begin transaction + SQL (0.4ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "66622731-6e36-42b7-9ac8-411a3d76f7a1"], ["id", 2]] +  (103.9ms) commit transaction +Completed 200 OK in 485ms (Views: 0.4ms | ActiveRecord: 105.5ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (122.1ms) commit transaction +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (99.7ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 11], ["user_group_id", 11]] +  (92.1ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (114.9ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 12]] +  (127.0ms) commit transaction + User Load (0.5ms) SELECT "users".* FROM "users" + User Load (0.4ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 02:19:37 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.2ms) +Completed 200 OK in 214ms (Views: 183.2ms | ActiveRecord: 0.7ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 02:19:37 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 02:19:37 +0300 +Started GET "/oauth/yandex?code=7441259" for 127.0.0.1 at 2016-05-15 02:19:39 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"7441259", "provider_name"=>"yandex"} + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.5ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.3ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "83449883-3ed3-49b1-b666-2cc90c2abdd1"], ["id", 2]] +  (107.2ms) commit transaction +Completed 200 OK in 460ms (Views: 0.6ms | ActiveRecord: 108.9ms) +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (119.2ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (105.4ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 12], ["user_group_id", 12]] +  (107.0ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (91.4ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 13]] +  (87.7ms) commit transaction + User Load (0.3ms) SELECT "users".* FROM "users" + User Load (0.3ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 02:21:16 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.5ms) +Completed 200 OK in 217ms (Views: 196.4ms | ActiveRecord: 0.6ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 02:21:16 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 02:21:16 +0300 +Started GET "/oauth/yandex?code=8446596" for 127.0.0.1 at 2016-05-15 02:21:18 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"8446596", "provider_name"=>"yandex"} + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.8ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "0385f876-cec5-4574-b24a-1d798f803c63"], ["id", 2]] +  (152.9ms) commit transaction +Completed 200 OK in 376ms (Views: 0.4ms | ActiveRecord: 154.7ms) +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (127.2ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (109.1ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 13], ["user_group_id", 13]] +  (109.3ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (98.7ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 14]] +  (112.1ms) commit transaction + User Load (0.4ms) SELECT "users".* FROM "users" + User Load (0.4ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 02:21:41 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.1ms) +Completed 200 OK in 246ms (Views: 223.6ms | ActiveRecord: 0.7ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 02:21:41 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 02:21:41 +0300 +Started GET "/oauth/yandex?code=4014967" for 127.0.0.1 at 2016-05-15 02:21:44 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"4014967", "provider_name"=>"yandex"} + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.8ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.1ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "a5b7d5be-affb-4d51-bfe2-7cd7ecb4c73f"], ["id", 2]] +  (182.0ms) commit transaction +Completed 200 OK in 434ms (Views: 0.6ms | ActiveRecord: 183.9ms) +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 14], ["user_group_id", 14]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.1ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 15]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 + User Load (0.1ms) SELECT "users".* FROM "users" + User Load (0.1ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 02:31:44 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.4ms) +Completed 200 OK in 223ms (Views: 200.2ms | ActiveRecord: 0.7ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 02:31:44 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 02:31:44 +0300 +Started GET "/oauth/yandex?code=2115546" for 127.0.0.1 at 2016-05-15 02:31:46 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"2115546", "provider_name"=>"yandex"} + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (5011.7ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "24f9b2d2-901e-4272-a3be-a167426cc03e"], ["id", 2]] +  (0.3ms) rollback transaction +Completed 500 Internal Server Error in 5313ms (ActiveRecord: 5013.0ms) +  (0.5ms) rollback transaction +  (0.1ms) begin transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (109.5ms) commit transaction +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (109.8ms) commit transaction +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 14], ["user_group_id", 14]] +  (115.0ms) commit transaction +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (84.1ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 15]] +  (118.5ms) commit transaction + User Load (0.2ms) SELECT "users".* FROM "users" + User Load (0.1ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 02:36:23 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.2ms) +Completed 200 OK in 236ms (Views: 214.5ms | ActiveRecord: 0.7ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 02:36:23 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 02:36:23 +0300 +Started GET "/oauth/yandex?code=9583324" for 127.0.0.1 at 2016-05-15 02:36:25 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"9583324", "provider_name"=>"yandex"} + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.8ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "3e15bad0-bf47-472e-8908-8ed343edd87c"], ["id", 2]] +  (160.5ms) commit transaction +Completed 200 OK in 357ms (Views: 0.7ms | ActiveRecord: 162.5ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (106.2ms) commit transaction +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (109.3ms) commit transaction +  (0.2ms) begin transaction + SQL (0.6ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 15], ["user_group_id", 15]] +  (90.4ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (98.3ms) commit transaction +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 16]] +  (129.6ms) commit transaction + User Load (0.2ms) SELECT "users".* FROM "users" + User Load (0.1ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 02:36:42 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.1ms) +Completed 200 OK in 254ms (Views: 232.6ms | ActiveRecord: 0.7ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 02:36:43 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 02:36:43 +0300 +Started GET "/oauth/yandex?code=2589298" for 127.0.0.1 at 2016-05-15 02:36:45 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"2589298", "provider_name"=>"yandex"} + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "ca77aff7-9048-440d-9dc0-73d48ef632f0"], ["id", 2]] +  (112.3ms) commit transaction +Completed 200 OK in 316ms (Views: 0.3ms | ActiveRecord: 114.0ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (124.5ms) commit transaction +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (105.8ms) commit transaction +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 16], ["user_group_id", 16]] +  (107.7ms) commit transaction +  (0.0ms) begin transaction + SQL (0.2ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (99.4ms) commit transaction +  (0.0ms) begin transaction + SQL (0.2ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 17]] +  (101.2ms) commit transaction + User Load (0.3ms) SELECT "users".* FROM "users" + User Load (0.2ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 02:37:28 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.2ms) +Completed 200 OK in 222ms (Views: 201.8ms | ActiveRecord: 0.6ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 02:37:28 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 02:37:28 +0300 +Started GET "/oauth/yandex?code=5642776" for 127.0.0.1 at 2016-05-15 02:37:30 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"5642776", "provider_name"=>"yandex"} + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.5ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "a6d5ba12-85b5-4c79-b4d5-c602c9378ce3"], ["id", 2]] +  (113.8ms) commit transaction +Completed 200 OK in 334ms (Views: 0.6ms | ActiveRecord: 115.5ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (116.5ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (101.3ms) commit transaction +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 17], ["user_group_id", 17]] +  (89.8ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (90.0ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 18]] +  (102.3ms) commit transaction + User Load (0.5ms) SELECT "users".* FROM "users" + User Load (0.4ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 02:37:54 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.4ms) +Completed 200 OK in 255ms (Views: 234.5ms | ActiveRecord: 0.7ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 02:37:54 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 02:37:54 +0300 +Started GET "/oauth/yandex?code=2268788" for 127.0.0.1 at 2016-05-15 02:37:56 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"2268788", "provider_name"=>"yandex"} + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.5ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "b5d2e061-849f-4d2e-8a8c-91ca2fa982ab"], ["id", 2]] +  (122.0ms) commit transaction +Completed 200 OK in 319ms (Views: 0.5ms | ActiveRecord: 123.6ms) +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (118.3ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (90.1ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 18], ["user_group_id", 18]] +  (106.2ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (98.9ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 19]] +  (111.7ms) commit transaction + User Load (0.4ms) SELECT "users".* FROM "users" + User Load (0.4ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 02:39:04 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (2.9ms) +Completed 200 OK in 214ms (Views: 185.4ms | ActiveRecord: 0.7ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 02:39:04 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 02:39:04 +0300 +Started GET "/oauth/yandex?code=8722432" for 127.0.0.1 at 2016-05-15 02:39:06 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"8722432", "provider_name"=>"yandex"} + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (1.0ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "e6cbf341-abd6-4667-b7ce-1ae5e34c1e34"], ["id", 2]] +  (157.1ms) commit transaction +Completed 200 OK in 497ms (Views: 0.6ms | ActiveRecord: 159.2ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (130.9ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (105.7ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 19], ["user_group_id", 19]] +  (108.0ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (98.4ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 20]] +  (110.4ms) commit transaction + User Load (0.4ms) SELECT "users".* FROM "users" + User Load (0.4ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 02:41:24 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.4ms) +Completed 200 OK in 226ms (Views: 199.7ms | ActiveRecord: 0.8ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 02:41:25 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 02:41:25 +0300 +Started GET "/oauth/yandex?code=9882007" for 127.0.0.1 at 2016-05-15 02:41:27 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"9882007", "provider_name"=>"yandex"} + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.6ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "fee8e1b5-8e3c-46db-8c6c-cfba5acc211f"], ["id", 2]] +  (168.4ms) commit transaction +Completed 200 OK in 396ms (Views: 0.4ms | ActiveRecord: 170.2ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.0ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (124.8ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (91.8ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 20], ["user_group_id", 20]] +  (107.2ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (102.0ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 21]] +  (110.5ms) commit transaction + User Load (0.5ms) SELECT "users".* FROM "users" + User Load (0.4ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 02:41:52 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.4ms) +Completed 200 OK in 225ms (Views: 204.5ms | ActiveRecord: 0.7ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 02:41:52 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 02:41:52 +0300 +Started GET "/oauth/yandex?code=7151886" for 127.0.0.1 at 2016-05-15 02:41:54 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"7151886", "provider_name"=>"yandex"} + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.1ms) begin transaction + SQL (0.4ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "07fb82f1-152e-4846-ac10-fc82b5983b3c"], ["id", 2]] +  (135.1ms) commit transaction +Completed 200 OK in 325ms (Views: 0.6ms | ActiveRecord: 136.3ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (132.9ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (91.1ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 21], ["user_group_id", 21]] +  (101.3ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (138.6ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 22]] +  (129.0ms) commit transaction + User Load (0.6ms) SELECT "users".* FROM "users" + User Load (0.4ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 02:44:03 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (2.9ms) +Completed 200 OK in 216ms (Views: 188.3ms | ActiveRecord: 0.7ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 02:44:03 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 02:44:03 +0300 +Started GET "/oauth/yandex?code=3193749" for 127.0.0.1 at 2016-05-15 02:44:05 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"3193749", "provider_name"=>"yandex"} + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.5ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "362f9b17-0068-4909-9119-9b57d3378f49"], ["id", 2]] +  (110.2ms) commit transaction +Completed 200 OK in 293ms (Views: 0.5ms | ActiveRecord: 111.9ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (109.0ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (107.1ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 22], ["user_group_id", 22]] +  (133.5ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (98.5ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 23]] +  (110.3ms) commit transaction + User Load (0.5ms) SELECT "users".* FROM "users" + User Load (0.4ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 02:46:51 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.4ms) +Completed 200 OK in 222ms (Views: 200.6ms | ActiveRecord: 0.7ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 02:46:51 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 02:46:51 +0300 +Started GET "/oauth/yandex?code=6000542" for 127.0.0.1 at 2016-05-15 02:46:54 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"6000542", "provider_name"=>"yandex"} + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.5ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.1ms) begin transaction + SQL (0.4ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "fbbf5c2e-fe5d-4a26-8004-3a44ee3a6326"], ["id", 2]] +  (158.1ms) commit transaction +Completed 200 OK in 372ms (Views: 0.4ms | ActiveRecord: 159.3ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (138.6ms) commit transaction +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (117.5ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 23], ["user_group_id", 23]] +  (106.2ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (96.2ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 24]] +  (107.6ms) commit transaction + User Load (0.5ms) SELECT "users".* FROM "users" + User Load (0.4ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 02:47:28 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.0ms) +Completed 200 OK in 217ms (Views: 189.0ms | ActiveRecord: 0.7ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 02:47:28 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 02:47:28 +0300 +Started GET "/oauth/yandex?code=2166335" for 127.0.0.1 at 2016-05-15 02:47:30 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"2166335", "provider_name"=>"yandex"} + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.5ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.1ms) begin transaction + SQL (0.3ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "9632fc60-77f1-4711-b22e-487c482a6ca1"], ["id", 2]] +  (125.0ms) commit transaction +Completed 200 OK in 435ms (Views: 0.6ms | ActiveRecord: 126.4ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (251.2ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (109.2ms) commit transaction +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 24], ["user_group_id", 24]] +  (115.6ms) commit transaction +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (113.9ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 25]] +  (122.5ms) commit transaction + User Load (0.3ms) SELECT "users".* FROM "users" + User Load (0.4ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 02:47:50 +0300 +Processing by LoginController#index as HTML + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (2.9ms) +Completed 200 OK in 246ms (Views: 216.2ms | ActiveRecord: 1.0ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 02:47:51 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 02:47:51 +0300 +Started GET "/oauth/yandex?code=8518933" for 127.0.0.1 at 2016-05-15 02:47:53 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"8518933", "provider_name"=>"yandex"} + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.8ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.1ms) begin transaction + SQL (0.4ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "31997ad3-f05c-4aa4-a518-2b9584552918"], ["id", 2]] +  (106.3ms) commit transaction +Completed 200 OK in 415ms (Views: 0.3ms | ActiveRecord: 108.0ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (99.3ms) commit transaction +  (0.1ms) begin transaction + SQL (0.6ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (110.1ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 25], ["user_group_id", 25]] +  (106.6ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (114.3ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 26]] +  (112.2ms) commit transaction + User Load (0.6ms) SELECT "users".* FROM "users" + User Load (0.5ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 02:48:43 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.5ms) +Completed 200 OK in 221ms (Views: 200.2ms | ActiveRecord: 0.7ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 02:48:43 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 02:48:43 +0300 +Started GET "/oauth/yandex?code=4268486" for 127.0.0.1 at 2016-05-15 02:48:45 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"4268486", "provider_name"=>"yandex"} + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.6ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.1ms) begin transaction + SQL (0.4ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "70f7d60f-e3cb-4240-9102-1a81aaa29ea9"], ["id", 2]] +  (148.5ms) commit transaction +Completed 200 OK in 443ms (Views: 0.4ms | ActiveRecord: 149.9ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.0ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (110.4ms) commit transaction +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (103.0ms) commit transaction +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 26], ["user_group_id", 26]] +  (92.6ms) commit transaction +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (83.6ms) commit transaction +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 27]] +  (115.9ms) commit transaction + User Load (0.2ms) SELECT "users".* FROM "users" + User Load (0.2ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 02:51:24 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.5ms) +Completed 200 OK in 227ms (Views: 204.1ms | ActiveRecord: 0.7ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 02:51:25 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 02:51:25 +0300 +Started GET "/oauth/yandex?code=9341534" for 127.0.0.1 at 2016-05-15 02:51:27 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"9341534", "provider_name"=>"yandex"} + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.3ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.1ms) begin transaction + SQL (0.3ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "462a2851-1c73-4c3f-8baf-1eab304cc9bc"], ["id", 2]] +  (201.5ms) commit transaction +Completed 200 OK in 369ms (Views: 0.2ms | ActiveRecord: 202.5ms) +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (113.1ms) commit transaction +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (89.7ms) commit transaction +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 27], ["user_group_id", 27]] +  (106.7ms) commit transaction +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (88.6ms) commit transaction +  (0.1ms) begin transaction + SQL (0.1ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 28]] +  (111.2ms) commit transaction + User Load (0.2ms) SELECT "users".* FROM "users" + User Load (0.1ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 02:51:47 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.2ms) +Completed 200 OK in 229ms (Views: 207.2ms | ActiveRecord: 0.7ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 02:51:48 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 02:51:48 +0300 +Started GET "/oauth/yandex?code=2547403" for 127.0.0.1 at 2016-05-15 02:51:50 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"2547403", "provider_name"=>"yandex"} + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.1ms) begin transaction + SQL (0.2ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "4c091aa3-28bb-4f6f-a3d6-012962b1e9e8"], ["id", 2]] +  (109.7ms) commit transaction +Completed 200 OK in 365ms (Views: 0.3ms | ActiveRecord: 110.6ms) +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (115.7ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (92.4ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 28], ["user_group_id", 28]] +  (107.7ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (124.7ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 29]] +  (125.3ms) commit transaction + User Load (0.4ms) SELECT "users".* FROM "users" + User Load (0.3ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 02:52:12 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.0ms) +Completed 200 OK in 256ms (Views: 229.5ms | ActiveRecord: 0.7ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 02:52:12 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 02:52:12 +0300 +Started GET "/oauth/yandex?code=5309577" for 127.0.0.1 at 2016-05-15 02:52:14 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"5309577", "provider_name"=>"yandex"} + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.9ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.1ms) begin transaction + SQL (0.4ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "c1a63fd3-5303-4aae-b6b5-7ac8b3c3ac71"], ["id", 2]] +  (156.5ms) commit transaction +Completed 200 OK in 344ms (Views: 0.5ms | ActiveRecord: 158.3ms) +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (107.5ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (109.4ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 29], ["user_group_id", 29]] +  (106.7ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (107.7ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 30]] +  (126.7ms) commit transaction + User Load (0.5ms) SELECT "users".* FROM "users" + User Load (0.5ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 02:52:56 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.2ms) +Completed 200 OK in 214ms (Views: 185.8ms | ActiveRecord: 0.7ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 02:52:56 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 02:52:56 +0300 +Started GET "/oauth/yandex?code=2100039" for 127.0.0.1 at 2016-05-15 02:52:59 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"2100039", "provider_name"=>"yandex"} + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.5ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.4ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "3db0792a-c417-47a9-bfe1-a73694c647dd"], ["id", 2]] +  (100.0ms) commit transaction +Completed 200 OK in 307ms (Views: 0.6ms | ActiveRecord: 101.4ms) +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (335.0ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (114.6ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 30], ["user_group_id", 30]] +  (123.5ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (119.3ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 31]] +  (126.6ms) commit transaction + User Load (0.5ms) SELECT "users".* FROM "users" + User Load (0.4ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 02:53:27 +0300 +Processing by LoginController#index as HTML + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.8ms) +Completed 200 OK in 221ms (Views: 201.0ms | ActiveRecord: 0.8ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 02:53:28 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 02:53:28 +0300 +Started GET "/oauth/yandex?code=9880368" for 127.0.0.1 at 2016-05-15 02:53:30 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"9880368", "provider_name"=>"yandex"} + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.7ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "445fc0eb-dbf7-4a9e-bd10-88d135a34ed8"], ["id", 2]] +  (190.4ms) commit transaction +Completed 200 OK in 472ms (Views: 0.6ms | ActiveRecord: 192.5ms) +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (109.6ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (105.9ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 31], ["user_group_id", 31]] +  (107.7ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (98.0ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 32]] +  (106.6ms) commit transaction + User Load (0.5ms) SELECT "users".* FROM "users" + User Load (0.4ms) SELECT "users".* FROM "users" +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.0ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (115.8ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (106.4ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 32], ["user_group_id", 32]] +  (116.7ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (123.1ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 33]] +  (135.3ms) commit transaction + User Load (0.5ms) SELECT "users".* FROM "users" + User Load (0.5ms) SELECT "users".* FROM "users" + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (111.9ms) commit transaction +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (92.2ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 33], ["user_group_id", 33]] +  (92.7ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (83.5ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 34]] +  (102.2ms) commit transaction + User Load (0.6ms) SELECT "users".* FROM "users" + User Load (0.3ms) SELECT "users".* FROM "users" + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (107.2ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (106.7ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 34], ["user_group_id", 34]] +  (106.8ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (106.4ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 35]] +  (118.3ms) commit transaction + User Load (0.5ms) SELECT "users".* FROM "users" + User Load (0.6ms) SELECT "users".* FROM "users" + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (122.6ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (107.5ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 35], ["user_group_id", 35]] +  (88.9ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (125.6ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 36]] +  (126.3ms) commit transaction + User Load (0.6ms) SELECT "users".* FROM "users" + User Load (0.6ms) SELECT "users".* FROM "users" + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (116.6ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (113.4ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 36], ["user_group_id", 36]] +  (123.7ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (98.3ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 37]] +  (93.8ms) commit transaction + User Load (0.6ms) SELECT "users".* FROM "users" + User Load (0.4ms) SELECT "users".* FROM "users" + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (108.4ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (107.2ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 37], ["user_group_id", 37]] +  (124.1ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (147.4ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 38]] +  (95.0ms) commit transaction + User Load (0.6ms) SELECT "users".* FROM "users" + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (109.7ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (107.8ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 38], ["user_group_id", 38]] +  (90.4ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (90.0ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 39]] +  (94.5ms) commit transaction + User Load (0.5ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 03:09:33 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (5.2ms) +Completed 200 OK in 243ms (Views: 203.5ms | ActiveRecord: 1.0ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 03:09:34 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 03:09:34 +0300 +Started GET "/oauth/yandex?code=8046131" for 127.0.0.1 at 2016-05-15 03:09:36 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"8046131", "provider_name"=>"yandex"} + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.8ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.4ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "1621e374-1414-493a-b31e-3c0240f85d8d"], ["id", 2]] +  (104.5ms) commit transaction +Completed 200 OK in 333ms (Views: 0.4ms | ActiveRecord: 106.5ms) +Started GET "/test" for 127.0.0.1 at 2016-05-15 03:09:36 +0300 + User Load (0.2ms) SELECT "users".* FROM "users" +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.0ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (118.5ms) commit transaction +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (106.1ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 39], ["user_group_id", 39]] +  (105.2ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (106.6ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 40]] +  (119.4ms) commit transaction + User Load (0.6ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 03:10:07 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.6ms) +Completed 200 OK in 220ms (Views: 196.6ms | ActiveRecord: 0.8ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 03:10:08 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 03:10:08 +0300 +Started GET "/oauth/yandex?code=8116849" for 127.0.0.1 at 2016-05-15 03:10:10 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"8116849", "provider_name"=>"yandex"} + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.7ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.1ms) begin transaction + SQL (0.4ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "6756bef1-75f8-40f3-89ce-e2af7810cf6f"], ["id", 2]] +  (141.2ms) commit transaction +Completed 200 OK in 335ms (Views: 0.5ms | ActiveRecord: 142.9ms) +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (122.9ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (105.9ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 40], ["user_group_id", 40]] +  (116.8ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (106.8ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 41]] +  (110.3ms) commit transaction + User Load (0.6ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 03:13:56 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.8ms) +Completed 200 OK in 230ms (Views: 200.1ms | ActiveRecord: 0.7ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 03:13:56 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 03:13:56 +0300 +Started GET "/oauth/yandex?code=2085013" for 127.0.0.1 at 2016-05-15 03:13:59 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"2085013", "provider_name"=>"yandex"} + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.5ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.4ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "e5220b35-3dc9-4a0c-aede-1e7f389bb973"], ["id", 2]] +  (179.8ms) commit transaction +Completed 200 OK in 377ms (Views: 0.3ms | ActiveRecord: 181.4ms) +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (108.8ms) commit transaction +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (122.4ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 41], ["user_group_id", 41]] +  (109.1ms) commit transaction +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (106.8ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 42]] +  (110.6ms) commit transaction + User Load (0.6ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 03:15:11 +0300 +Processing by LoginController#index as HTML + User Load (0.6ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.5ms) +Completed 200 OK in 280ms (Views: 237.7ms | ActiveRecord: 1.3ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 03:15:11 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 03:15:11 +0300 +Started GET "/oauth/yandex?code=1728331" for 127.0.0.1 at 2016-05-15 03:15:12 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"1728331", "provider_name"=>"yandex"} + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.6ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.1ms) begin transaction + SQL (0.4ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "420597e4-4d54-4b77-8359-7689d13aa6cd"], ["id", 2]] +  (102.7ms) commit transaction +Completed 200 OK in 298ms (Views: 0.5ms | ActiveRecord: 104.4ms) +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (120.5ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (105.8ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 42], ["user_group_id", 42]] +  (149.7ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (106.7ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 43]] +  (111.3ms) commit transaction + User Load (0.5ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 03:15:51 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.3ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (6.1ms) +Completed 200 OK in 261ms (Views: 238.3ms | ActiveRecord: 0.9ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 03:15:51 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 03:15:51 +0300 +Started GET "/oauth/yandex?code=4621708" for 127.0.0.1 at 2016-05-15 03:15:53 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"4621708", "provider_name"=>"yandex"} + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.1ms) begin transaction + SQL (0.4ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "994b85da-6980-4061-854b-9dc162119396"], ["id", 2]] +  (112.7ms) commit transaction +Completed 200 OK in 356ms (Views: 0.5ms | ActiveRecord: 113.8ms) +Started GET "/test" for 127.0.0.1 at 2016-05-15 03:15:53 +0300 + User Load (0.6ms) SELECT "users".* FROM "users" +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (123.2ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (123.2ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 43], ["user_group_id", 43]] +  (125.2ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (122.8ms) commit transaction +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 44]] +  (125.7ms) commit transaction + User Load (0.7ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 03:17:10 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.3ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (7.0ms) +Completed 200 OK in 246ms (Views: 224.3ms | ActiveRecord: 0.8ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 03:17:10 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 03:17:10 +0300 +Started GET "/oauth/yandex?code=7423307" for 127.0.0.1 at 2016-05-15 03:17:11 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"7423307", "provider_name"=>"yandex"} + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.3ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "1dcbd53a-4e77-44ca-bb4f-05eaeeee52b5"], ["id", 2]] +  (116.0ms) commit transaction +Completed 200 OK in 315ms (Views: 0.3ms | ActiveRecord: 117.3ms) +Started GET "/test" for 127.0.0.1 at 2016-05-15 03:17:11 +0300 + User Load (0.5ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 03:17:11 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.5ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (0.4ms) +Completed 200 OK in 9ms (Views: 3.6ms | ActiveRecord: 0.7ms) +Started GET "/oauth/yandex?code=7719646" for 127.0.0.1 at 2016-05-15 03:17:12 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"7719646", "provider_name"=>"yandex"} + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.9ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.4ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "da51100f-17c4-49f8-b066-f301233fac8d"], ["id", 2]] +  (106.6ms) commit transaction +Completed 200 OK in 313ms (Views: 0.4ms | ActiveRecord: 108.5ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (136.7ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (106.0ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 44], ["user_group_id", 44]] +  (116.5ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (142.7ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 45]] +  (111.4ms) commit transaction + User Load (0.7ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 03:18:13 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (6.3ms) +Completed 200 OK in 241ms (Views: 222.7ms | ActiveRecord: 0.7ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 03:18:14 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 03:18:14 +0300 +Started GET "/oauth/yandex?code=7052572" for 127.0.0.1 at 2016-05-15 03:18:15 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"7052572", "provider_name"=>"yandex"} + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.3ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.4ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "7116d824-3539-474c-b07c-7c829a87cb93"], ["id", 2]] +  (107.5ms) commit transaction +Completed 200 OK in 331ms (Views: 0.5ms | ActiveRecord: 109.0ms) +Started GET "/test" for 127.0.0.1 at 2016-05-15 03:18:15 +0300 +Processing by TestController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 +Filter chain halted as :check_access rendered or redirected +Completed 403 Forbidden in 8ms (Views: 0.5ms | ActiveRecord: 0.7ms) + User Load (0.8ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 03:18:15 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.9ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (0.6ms) +Completed 200 OK in 11ms (Views: 4.4ms | ActiveRecord: 1.1ms) +Started GET "/oauth/yandex?code=4340303" for 127.0.0.1 at 2016-05-15 03:18:15 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"4340303", "provider_name"=>"yandex"} + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.8ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.4ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "2ca82392-5dd8-4f67-8516-27f934ccd3a1"], ["id", 2]] +  (112.4ms) commit transaction +Completed 200 OK in 303ms (Views: 0.4ms | ActiveRecord: 114.3ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (127.4ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (131.5ms) commit transaction +  (0.2ms) begin transaction + SQL (0.3ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 45], ["user_group_id", 45]] +  (108.4ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (107.9ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 46]] +  (111.2ms) commit transaction + User Load (0.7ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 03:18:51 +0300 +Processing by LoginController#index as HTML + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (2.4ms) +Completed 200 OK in 253ms (Views: 222.1ms | ActiveRecord: 1.1ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 03:18:51 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 03:18:51 +0300 +Started GET "/oauth/yandex?code=1610379" for 127.0.0.1 at 2016-05-15 03:18:52 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"1610379", "provider_name"=>"yandex"} + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "fe59af05-8603-4f32-81d6-ad08bb360cf0"], ["id", 2]] +  (110.6ms) commit transaction +Completed 200 OK in 268ms (Views: 0.2ms | ActiveRecord: 112.0ms) +Started GET "/test" for 127.0.0.1 at 2016-05-15 03:18:53 +0300 +Processing by TestController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.8ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 +Filter chain halted as :check_access rendered or redirected +Completed 403 Forbidden in 8ms (Views: 0.5ms | ActiveRecord: 1.0ms) + User Load (0.6ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 03:18:53 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.6ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (0.4ms) +Completed 200 OK in 10ms (Views: 2.7ms | ActiveRecord: 0.8ms) +Started GET "/oauth/yandex?code=6491908" for 127.0.0.1 at 2016-05-15 03:18:53 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"6491908", "provider_name"=>"yandex"} + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.8ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.1ms) begin transaction + SQL (0.2ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "983c5fbc-76a1-421e-9a44-147de0061792"], ["id", 2]] +  (121.8ms) commit transaction +Completed 200 OK in 303ms (Views: 0.4ms | ActiveRecord: 123.2ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (120.0ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (116.7ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 46], ["user_group_id", 46]] +  (115.2ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (106.7ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 47]] +  (109.7ms) commit transaction + User Load (0.6ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 03:19:17 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (6.0ms) +Completed 200 OK in 231ms (Views: 213.0ms | ActiveRecord: 0.6ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 03:19:17 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 03:19:17 +0300 +Started GET "/oauth/yandex?code=8870929" for 127.0.0.1 at 2016-05-15 03:19:18 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"8870929", "provider_name"=>"yandex"} + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.5ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "f6936851-d2de-4a4c-8de4-c9967e2ae2a6"], ["id", 2]] +  (132.8ms) commit transaction +Completed 200 OK in 443ms (Views: 0.6ms | ActiveRecord: 134.4ms) +Started GET "/test" for 127.0.0.1 at 2016-05-15 03:19:19 +0300 +Processing by TestController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 +Filter chain halted as :check_access rendered or redirected +Completed 403 Forbidden in 8ms (Views: 0.2ms | ActiveRecord: 0.7ms) + User Load (0.7ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 03:19:19 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.7ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (0.6ms) +Completed 200 OK in 13ms (Views: 3.5ms | ActiveRecord: 1.0ms) +Started GET "/oauth/yandex?code=9490020" for 127.0.0.1 at 2016-05-15 03:19:19 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"9490020", "provider_name"=>"yandex"} + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.6ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.1ms) begin transaction + SQL (0.3ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "dd5ea46a-25e3-43e6-a39a-e02099ad650e"], ["id", 2]] +  (110.6ms) commit transaction +Completed 200 OK in 302ms (Views: 0.4ms | ActiveRecord: 112.0ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (107.0ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (108.1ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 47], ["user_group_id", 47]] +  (107.2ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (107.7ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 48]] +  (120.6ms) commit transaction + User Load (0.7ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 03:20:02 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.3ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (6.9ms) +Completed 200 OK in 248ms (Views: 227.4ms | ActiveRecord: 0.8ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 03:20:02 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 03:20:02 +0300 +Started GET "/oauth/yandex?code=5323407" for 127.0.0.1 at 2016-05-15 03:20:03 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"5323407", "provider_name"=>"yandex"} + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.1ms) begin transaction + SQL (0.4ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "bf92d757-9b16-486b-923f-3ccb053d3876"], ["id", 2]] +  (105.0ms) commit transaction +Completed 200 OK in 320ms (Views: 0.3ms | ActiveRecord: 106.2ms) +Started GET "/test" for 127.0.0.1 at 2016-05-15 03:20:03 +0300 +Processing by TestController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "bf92d757-9b16-486b-923f-3ccb053d3876"]] + SQL (0.5ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Filter chain halted as :check_access rendered or redirected +Completed 401 Unauthorized in 7ms (Views: 0.3ms | ActiveRecord: 0.9ms) + User Load (0.5ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 03:20:04 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "bf92d757-9b16-486b-923f-3ccb053d3876"]] + SQL (0.6ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Filter chain halted as :check_access rendered or redirected +Completed 401 Unauthorized in 7ms (Views: 0.4ms | ActiveRecord: 0.8ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.0ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (134.7ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (91.8ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 48], ["user_group_id", 48]] +  (110.1ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (108.3ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 49]] +  (120.5ms) commit transaction + User Load (0.6ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 03:21:07 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (6.5ms) +Completed 200 OK in 247ms (Views: 226.7ms | ActiveRecord: 0.7ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 03:21:08 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 03:21:08 +0300 +Started GET "/oauth/yandex?code=8990768" for 127.0.0.1 at 2016-05-15 03:21:09 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"8990768", "provider_name"=>"yandex"} + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "4b8edb6c-66fb-4cbc-a376-8dcc2cd37ae2"], ["id", 2]] +  (116.3ms) commit transaction +Completed 200 OK in 329ms (Views: 0.5ms | ActiveRecord: 117.7ms) +Started GET "/test" for 127.0.0.1 at 2016-05-15 03:21:09 +0300 +Processing by TestController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "4b8edb6c-66fb-4cbc-a376-8dcc2cd37ae2"]] + SQL (0.3ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Filter chain halted as :check_access rendered or redirected +Completed 401 Unauthorized in 4ms (Views: 0.2ms | ActiveRecord: 0.6ms) +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ + User Load (0.5ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 03:21:09 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "4b8edb6c-66fb-4cbc-a376-8dcc2cd37ae2"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Filter chain halted as :check_access rendered or redirected +Completed 401 Unauthorized in 4ms (Views: 0.3ms | ActiveRecord: 0.6ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (109.6ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (116.0ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 49], ["user_group_id", 49]] +  (132.2ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (106.1ms) commit transaction +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 50]] +  (106.9ms) commit transaction + User Load (0.5ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 03:22:01 +0300 +Processing by LoginController#index as HTML + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (2.2ms) +Completed 200 OK in 230ms (Views: 203.4ms | ActiveRecord: 0.8ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 03:22:01 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 03:22:01 +0300 +Started GET "/oauth/yandex?code=4064616" for 127.0.0.1 at 2016-05-15 03:22:02 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"4064616", "provider_name"=>"yandex"} + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.8ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.1ms) begin transaction + SQL (0.4ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "71425d74-cc58-4d72-ba54-33aba9245907"], ["id", 2]] +  (113.2ms) commit transaction +Completed 200 OK in 299ms (Views: 0.5ms | ActiveRecord: 114.9ms) +Started GET "/test" for 127.0.0.1 at 2016-05-15 03:22:03 +0300 +Processing by TestController#index as HTML + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "71425d74-cc58-4d72-ba54-33aba9245907"]] + SQL (0.6ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Filter chain halted as :check_access rendered or redirected +Completed 401 Unauthorized in 7ms (Views: 0.3ms | ActiveRecord: 1.0ms) + User Load (0.5ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 03:22:03 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "71425d74-cc58-4d72-ba54-33aba9245907"]] + SQL (0.6ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Filter chain halted as :check_access rendered or redirected +Completed 401 Unauthorized in 5ms (Views: 0.3ms | ActiveRecord: 0.8ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (115.5ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (115.1ms) commit transaction +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 50], ["user_group_id", 50]] +  (124.3ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (106.6ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 51]] +  (104.2ms) commit transaction + User Load (0.7ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 03:23:56 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + Url Load (0.3ms) SELECT "urls".* FROM "urls" + SQL (0.3ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (2.3ms) +Completed 200 OK in 252ms (Views: 220.5ms | ActiveRecord: 1.1ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 03:23:56 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 03:23:56 +0300 +Started GET "/oauth/yandex?code=8817339" for 127.0.0.1 at 2016-05-15 03:23:57 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"8817339", "provider_name"=>"yandex"} + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + Url Load (0.6ms) SELECT "urls".* FROM "urls" + SQL (0.6ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "cf9fbe3c-6e10-435b-b95b-4ab8749fbd57"], ["id", 2]] +  (120.1ms) commit transaction +Completed 200 OK in 299ms (Views: 0.5ms | ActiveRecord: 122.5ms) +Started GET "/test" for 127.0.0.1 at 2016-05-15 03:23:58 +0300 +Processing by TestController#index as HTML + User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "cf9fbe3c-6e10-435b-b95b-4ab8749fbd57"]] + Url Load (0.4ms) SELECT "urls".* FROM "urls" + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Filter chain halted as :check_access rendered or redirected +Completed 401 Unauthorized in 8ms (Views: 0.2ms | ActiveRecord: 1.3ms) + User Load (0.8ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 03:23:58 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "cf9fbe3c-6e10-435b-b95b-4ab8749fbd57"]] + Url Load (0.4ms) SELECT "urls".* FROM "urls" + SQL (0.6ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Filter chain halted as :check_access rendered or redirected +Completed 401 Unauthorized in 10ms (Views: 0.3ms | ActiveRecord: 1.3ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (136.8ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (105.1ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 51], ["user_group_id", 51]] +  (107.2ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (106.4ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 52]] +  (110.1ms) commit transaction + User Load (0.7ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 03:24:41 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.3ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (7.8ms) +Completed 200 OK in 243ms (Views: 220.5ms | ActiveRecord: 0.9ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 03:24:41 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 03:24:41 +0300 +Started GET "/oauth/yandex?code=2424074" for 127.0.0.1 at 2016-05-15 03:24:43 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"2424074", "provider_name"=>"yandex"} + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.3ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.1ms) begin transaction + SQL (0.3ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "a048d043-fd0d-4ed3-a159-37ea88aa1428"], ["id", 2]] +  (108.7ms) commit transaction +Completed 200 OK in 288ms (Views: 0.2ms | ActiveRecord: 109.6ms) +Started GET "/test" for 127.0.0.1 at 2016-05-15 03:24:43 +0300 +Processing by TestController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "a048d043-fd0d-4ed3-a159-37ea88aa1428"]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "a048d043-fd0d-4ed3-a159-37ea88aa1428"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Filter chain halted as :check_access rendered or redirected +Completed 401 Unauthorized in 5ms (Views: 0.2ms | ActiveRecord: 0.7ms) + User Load (0.6ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 03:24:43 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "a048d043-fd0d-4ed3-a159-37ea88aa1428"]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "a048d043-fd0d-4ed3-a159-37ea88aa1428"]] + SQL (1.1ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Filter chain halted as :check_access rendered or redirected +Completed 401 Unauthorized in 6ms (Views: 0.3ms | ActiveRecord: 1.3ms) + Url Load (0.8ms) SELECT "urls".* FROM "urls" +  (88.3ms) CREATE TABLE "urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "url_pattern" varchar, "name" varchar, "http_method" varchar)  +  (114.7ms) CREATE TABLE "user_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar) +  (0.3ms) select sqlite_version(*) +  (98.7ms) CREATE INDEX "index_user_groups_on_name" ON "user_groups" ("name") +  (98.2ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "api_code" varchar)  +  (98.5ms) CREATE INDEX "index_users_on_name" ON "users" ("name") +  (107.7ms) CREATE TABLE "users_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_group_id" integer, "user_id" integer)  +  (131.8ms) CREATE TABLE "users_urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "users_group_id" integer, "url_id" integer) +  (104.9ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)  +  (106.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version") +  (0.3ms) SELECT version FROM "schema_migrations" +  (106.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20160514163909') + ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (83.0ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (98.8ms) commit transaction +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 1], ["user_group_id", 1]] +  (102.2ms) commit transaction +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (96.9ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 1]] +  (138.1ms) commit transaction + User Load (0.4ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 03:27:23 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] +Completed 500 Internal Server Error in 5ms (ActiveRecord: 0.2ms) +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]] +  (0.0ms) rollback transaction +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (108.0ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (98.9ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]] +  (98.8ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (100.2ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 2]] +  (120.2ms) commit transaction + User Load (0.4ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 03:28:16 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] +Completed 500 Internal Server Error in 4ms (ActiveRecord: 0.3ms) +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (114.4ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (115.7ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 3], ["user_group_id", 3]] +  (115.0ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (102.7ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 3]] +  (121.0ms) commit transaction + User Load (0.4ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 03:28:54 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] +Completed 500 Internal Server Error in 4ms (ActiveRecord: 0.3ms) +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (121.1ms) CREATE TABLE "urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "url_pattern" varchar, "name" varchar, "http_method" varchar)  +  (106.4ms) CREATE TABLE "user_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar) +  (0.3ms) select sqlite_version(*) +  (98.5ms) CREATE INDEX "index_user_groups_on_name" ON "user_groups" ("name") +  (98.7ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "api_code" varchar)  +  (98.5ms) CREATE INDEX "index_users_on_name" ON "users" ("name") +  (108.1ms) CREATE TABLE "users_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_group_id" integer, "user_id" integer)  +  (98.7ms) CREATE TABLE "users_urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "users_group_id" integer, "url_id" integer) +  (104.6ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)  +  (123.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version") +  (0.3ms) SELECT version FROM "schema_migrations" +  (82.2ms) INSERT INTO "schema_migrations" (version) VALUES ('20160514163909') + ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]] +  (96.5ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"], ["id", 1]] +  (99.3ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"], ["id", 2]] +  (96.0ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("id", "name") VALUES (?, ?) [["id", 1], ["name", "Guest"]] +  (97.4ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("id", "user_id", "user_group_id") VALUES (?, ?, ?) [["id", 1], ["user_id", 1], ["user_group_id", 1]] +  (99.2ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 1], ["url_id", 1], ["users_group_id", 1]] +  (111.1ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 2], ["url_id", 2], ["users_group_id", 1]] +  (112.5ms) commit transaction +  (0.2ms) begin transaction + SQL (0.6ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (120.4ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (104.0ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]] +  (103.9ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (103.5ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 3]] +  (104.0ms) commit transaction + User Load (0.4ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 03:30:01 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (2.3ms) +Completed 200 OK in 228ms (Views: 202.1ms | ActiveRecord: 0.8ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 03:30:02 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 03:30:02 +0300 +Started GET "/oauth/yandex?code=6369025" for 127.0.0.1 at 2016-05-15 03:30:03 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"6369025", "provider_name"=>"yandex"} + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.7ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.1ms) begin transaction + SQL (0.3ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "bcf3a1bc-c5dd-48cd-8b94-985373ffd352"], ["id", 2]] +  (108.7ms) commit transaction +Completed 200 OK in 302ms (Views: 0.2ms | ActiveRecord: 110.3ms) +Started GET "/test" for 127.0.0.1 at 2016-05-15 03:30:03 +0300 +Processing by TestController#index as HTML + User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "bcf3a1bc-c5dd-48cd-8b94-985373ffd352"]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "bcf3a1bc-c5dd-48cd-8b94-985373ffd352"]] + SQL (0.5ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Filter chain halted as :check_access rendered or redirected +Completed 401 Unauthorized in 8ms (Views: 0.4ms | ActiveRecord: 1.0ms) + User Load (0.5ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 03:30:03 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "bcf3a1bc-c5dd-48cd-8b94-985373ffd352"]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "bcf3a1bc-c5dd-48cd-8b94-985373ffd352"]] + SQL (0.5ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Filter chain halted as :check_access rendered or redirected +Completed 401 Unauthorized in 5ms (Views: 0.3ms | ActiveRecord: 0.7ms) +  (90.9ms) CREATE TABLE "urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "url_pattern" varchar, "name" varchar, "http_method" varchar)  +  (90.6ms) CREATE TABLE "user_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar) +  (0.2ms) select sqlite_version(*) +  (106.9ms) CREATE INDEX "index_user_groups_on_name" ON "user_groups" ("name") +  (98.6ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "api_code" varchar)  +  (98.8ms) CREATE INDEX "index_users_on_name" ON "users" ("name") +  (107.7ms) CREATE TABLE "users_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_group_id" integer, "user_id" integer)  +  (82.1ms) CREATE TABLE "users_urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "users_group_id" integer, "url_id" integer) +  (96.3ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)  +  (74.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version") +  (0.3ms) SELECT version FROM "schema_migrations" +  (82.1ms) INSERT INTO "schema_migrations" (version) VALUES ('20160514163909') + ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ + User Load (0.1ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 03:36:56 +0300 +Processing by LoginController#index as HTML + User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] +Completed 500 Internal Server Error in 13ms (ActiveRecord: 0.5ms) +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.0ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]] +  (99.0ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"], ["id", 1]] +  (87.9ms) commit transaction +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"], ["id", 2]] +  (96.8ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("id", "name") VALUES (?, ?) [["id", 1], ["name", "Guest"]] +  (97.2ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("id", "user_id", "user_group_id") VALUES (?, ?, ?) [["id", 1], ["user_id", 1], ["user_group_id", 1]] +  (98.1ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 1], ["url_id", 1], ["users_group_id", 1]] +  (102.4ms) commit transaction +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 2], ["url_id", 2], ["users_group_id", 1]] +  (96.9ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (89.0ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (104.3ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]] +  (88.1ms) commit transaction +  (0.2ms) begin transaction + SQL (0.6ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (103.6ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("url_id", "users_group_id") VALUES (?, ?) [["url_id", 3], ["users_group_id", 2]] +  (96.2ms) commit transaction + User Load (0.3ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 03:37:20 +0300 +Processing by LoginController#index as HTML + User Load (0.6ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.3ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (8.4ms) +Completed 200 OK in 263ms (Views: 225.0ms | ActiveRecord: 1.3ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 03:37:20 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 03:37:20 +0300 +Started GET "/oauth/yandex?code=6568553" for 127.0.0.1 at 2016-05-15 03:37:21 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"6568553", "provider_name"=>"yandex"} + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.7ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "efc71b3d-6f74-4508-9b29-5c906edc1ebe"], ["id", 2]] +  (119.9ms) commit transaction +Completed 200 OK in 344ms (Views: 0.4ms | ActiveRecord: 121.8ms) +Started GET "/test" for 127.0.0.1 at 2016-05-15 03:37:22 +0300 +Processing by TestController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "efc71b3d-6f74-4508-9b29-5c906edc1ebe"]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "efc71b3d-6f74-4508-9b29-5c906edc1ebe"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Completed 200 OK in 6ms (Views: 0.2ms | ActiveRecord: 0.7ms) +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ + User Load (0.4ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 03:37:22 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "efc71b3d-6f74-4508-9b29-5c906edc1ebe"]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "efc71b3d-6f74-4508-9b29-5c906edc1ebe"]] + SQL (0.5ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Filter chain halted as :check_access rendered or redirected +Completed 401 Unauthorized in 7ms (Views: 0.3ms | ActiveRecord: 0.9ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.0ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]] +  (0.0ms) rollback transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (115.4ms) commit transaction +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (90.8ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 3], ["user_group_id", 3]] +  (103.3ms) commit transaction +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (124.3ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("url_id", "users_group_id") VALUES (?, ?) [["url_id", 4], ["users_group_id", 3]] +  (102.4ms) commit transaction +Started GET "/login" for 127.0.0.1 at 2016-05-15 17:09:02 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (2.2ms) +Completed 200 OK in 234ms (Views: 214.6ms | ActiveRecord: 0.7ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 17:09:03 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 17:09:03 +0300 +Started GET "/oauth/yandex?code=1569140" for 127.0.0.1 at 2016-05-15 17:09:04 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"1569140", "provider_name"=>"yandex"} + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.8ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "03285d19-25a7-4925-96be-8c4261282b07"], ["id", 2]] +  (136.6ms) commit transaction +Completed 200 OK in 315ms (Views: 0.4ms | ActiveRecord: 138.7ms) +Started GET "/test" for 127.0.0.1 at 2016-05-15 17:09:05 +0300 +Processing by TestController#index as HTML + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "03285d19-25a7-4925-96be-8c4261282b07"]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "03285d19-25a7-4925-96be-8c4261282b07"]] + SQL (0.5ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Completed 200 OK in 7ms (Views: 0.3ms | ActiveRecord: 0.9ms) +Started GET "/login" for 127.0.0.1 at 2016-05-15 17:09:05 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "03285d19-25a7-4925-96be-8c4261282b07"]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "03285d19-25a7-4925-96be-8c4261282b07"]] + SQL (0.5ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Filter chain halted as :check_access rendered or redirected +Completed 401 Unauthorized in 6ms (Views: 0.3ms | ActiveRecord: 0.7ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (81.8ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (105.1ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 4], ["user_group_id", 4]] +  (106.7ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (97.8ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id", "users_group_id") VALUES (?, ?) [["url_id", 5], ["users_group_id", 4]] +  (97.6ms) commit transaction + User Load (0.4ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 17:09:29 +0300 +Processing by LoginController#index as HTML + User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.3ms) +Completed 200 OK in 251ms (Views: 205.2ms | ActiveRecord: 1.3ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 17:09:29 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 17:09:29 +0300 +Started GET "/oauth/yandex?code=6299451" for 127.0.0.1 at 2016-05-15 17:09:30 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"6299451", "provider_name"=>"yandex"} + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.7ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "c0111f37-9332-4c99-9674-e8f22678e44b"], ["id", 2]] +  (152.3ms) commit transaction +Completed 200 OK in 515ms (Views: 0.4ms | ActiveRecord: 154.2ms) +Started GET "/test" for 127.0.0.1 at 2016-05-15 17:09:31 +0300 +Processing by TestController#index as HTML + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "c0111f37-9332-4c99-9674-e8f22678e44b"]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "c0111f37-9332-4c99-9674-e8f22678e44b"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Completed 200 OK in 7ms (Views: 0.3ms | ActiveRecord: 0.8ms) +Started GET "/login" for 127.0.0.1 at 2016-05-15 17:09:31 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "c0111f37-9332-4c99-9674-e8f22678e44b"]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "c0111f37-9332-4c99-9674-e8f22678e44b"]] + SQL (0.7ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Filter chain halted as :check_access rendered or redirected +Completed 401 Unauthorized in 7ms (Views: 0.4ms | ActiveRecord: 1.0ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (95.4ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (101.2ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 5], ["user_group_id", 5]] +  (93.8ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (88.8ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id", "users_group_id") VALUES (?, ?) [["url_id", 6], ["users_group_id", 5]] +  (113.7ms) commit transaction + User Load (0.4ms) SELECT "users".* FROM "users" +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (92.3ms) commit transaction +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (90.8ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 6], ["user_group_id", 6]] +  (91.9ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (99.8ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id", "users_group_id") VALUES (?, ?) [["url_id", 7], ["users_group_id", 6]] +  (114.0ms) commit transaction + User Load (0.5ms) SELECT "users".* FROM "users" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +Started GET "/login" for 127.0.0.1 at 2016-05-15 17:16:11 +0300 +Processing by LoginController#index as HTML + User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.0ms) +Completed 200 OK in 255ms (Views: 214.8ms | ActiveRecord: 1.2ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 17:16:11 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 17:16:11 +0300 +Started GET "/oauth/yandex?code=2393644" for 127.0.0.1 at 2016-05-15 17:16:12 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"2393644", "provider_name"=>"yandex"} + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.5ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "e459cb15-f1f6-4e91-a603-6ad531c7954d"], ["id", 2]] +  (119.6ms) commit transaction +Completed 200 OK in 495ms (Views: 0.5ms | ActiveRecord: 121.2ms) + User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 17:16:13 +0300 +Processing by TestController#index as HTML + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "e459cb15-f1f6-4e91-a603-6ad531c7954d"]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "e459cb15-f1f6-4e91-a603-6ad531c7954d"]] + SQL (0.5ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Completed 200 OK in 8ms (Views: 0.3ms | ActiveRecord: 0.9ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (110.3ms) commit transaction +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (89.1ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 7], ["user_group_id", 7]] +  (93.7ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (91.1ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("url_id", "users_group_id") VALUES (?, ?) [["url_id", 8], ["users_group_id", 7]] +  (102.9ms) commit transaction + User Load (0.4ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 17:17:18 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (2.3ms) +Completed 200 OK in 228ms (Views: 198.9ms | ActiveRecord: 0.8ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 17:17:18 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 17:17:18 +0300 +Started GET "/oauth/yandex?code=1485591" for 127.0.0.1 at 2016-05-15 17:17:20 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"1485591", "provider_name"=>"yandex"} + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "bf281365-d29e-48d9-b29a-079ad3124906"], ["id", 2]] +  (86.5ms) commit transaction +Completed 200 OK in 306ms (Views: 0.4ms | ActiveRecord: 88.0ms) + User Load (0.7ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 17:17:20 +0300 +Processing by TestController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "bf281365-d29e-48d9-b29a-079ad3124906"]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "bf281365-d29e-48d9-b29a-079ad3124906"]] + SQL (0.3ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Completed 200 OK in 4ms (Views: 0.2ms | ActiveRecord: 0.6ms) +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) begin transaction + SQL (0.3ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (134.9ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (116.8ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 8], ["user_group_id", 8]] +  (106.8ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (115.2ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("url_id", "users_group_id") VALUES (?, ?) [["url_id", 9], ["users_group_id", 8]] +  (101.9ms) commit transaction + User Load (0.4ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 17:18:26 +0300 +Processing by LoginController#index as HTML + User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.3ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (4.2ms) +Completed 200 OK in 265ms (Views: 217.7ms | ActiveRecord: 1.2ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 17:18:26 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 17:18:26 +0300 +Started GET "/oauth/yandex?code=7401349" for 127.0.0.1 at 2016-05-15 17:18:28 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"7401349", "provider_name"=>"yandex"} + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.6ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "6da5edad-2447-47b1-a201-e5949c99d365"], ["id", 2]] +  (90.5ms) commit transaction +Completed 200 OK in 306ms (Views: 0.5ms | ActiveRecord: 92.2ms) + User Load (0.6ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 17:18:28 +0300 +Processing by TestController#index as HTML + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "6da5edad-2447-47b1-a201-e5949c99d365"]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "6da5edad-2447-47b1-a201-e5949c99d365"]] + SQL (0.5ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Completed 200 OK in 8ms (Views: 0.3ms | ActiveRecord: 1.0ms) +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (93.4ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (81.8ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 9], ["user_group_id", 9]] +  (99.1ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (103.2ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("url_id", "users_group_id") VALUES (?, ?) [["url_id", 10], ["users_group_id", 9]] +  (102.1ms) commit transaction + User Load (0.5ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 17:22:26 +0300 +Processing by LoginController#index as HTML + User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.2ms) +Completed 200 OK in 256ms (Views: 208.2ms | ActiveRecord: 1.4ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 17:22:26 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 17:22:26 +0300 +Started GET "/oauth/yandex?code=3369838" for 127.0.0.1 at 2016-05-15 17:22:28 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"3369838", "provider_name"=>"yandex"} + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "b937c860-cac6-4390-9304-96956a51c9cd"], ["id", 2]] +  (100.4ms) commit transaction +Completed 200 OK in 279ms (Views: 0.5ms | ActiveRecord: 101.5ms) + User Load (0.6ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 17:22:28 +0300 +Processing by TestController#index as HTML + User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "b937c860-cac6-4390-9304-96956a51c9cd"]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "b937c860-cac6-4390-9304-96956a51c9cd"]] + SQL (0.6ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Completed 200 OK in 9ms (Views: 0.3ms | ActiveRecord: 1.1ms) +Started GET "/logout" for 127.0.0.1 at 2016-05-15 17:22:28 +0300 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (95.8ms) CREATE TABLE "urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "url_pattern" varchar, "name" varchar, "http_method" varchar)  +  (98.7ms) CREATE TABLE "user_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar) +  (0.2ms) select sqlite_version(*) +  (98.1ms) CREATE INDEX "index_user_groups_on_name" ON "user_groups" ("name") +  (98.3ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "api_code" varchar)  +  (123.5ms) CREATE INDEX "index_users_on_name" ON "users" ("name") +  (124.3ms) CREATE TABLE "users_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_group_id" integer, "user_id" integer)  +  (115.3ms) CREATE TABLE "users_urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "users_group_id" integer, "url_id" integer) +  (121.2ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)  +  (98.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version") +  (0.3ms) SELECT version FROM "schema_migrations" +  (98.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20160514163909') + ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]] +  (114.1ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"], ["id", 1]] +  (90.8ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"], ["id", 2]] +  (146.4ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "user_groups" ("id", "name") VALUES (?, ?) [["id", 1], ["name", "Guest"]] +  (110.4ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("id", "user_id", "user_group_id") VALUES (?, ?, ?) [["id", 1], ["user_id", 1], ["user_group_id", 1]] +  (98.8ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 1], ["url_id", 1], ["users_group_id", 1]] +  (104.2ms) commit transaction +  (0.3ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 2], ["url_id", 2], ["users_group_id", 1]] +  (104.3ms) commit transaction +  (0.2ms) begin transaction + SQL (0.6ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (95.7ms) commit transaction +  (0.2ms) begin transaction + SQL (0.6ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (104.1ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]] +  (95.7ms) commit transaction +  (0.3ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (95.5ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("url_id", "users_group_id") VALUES (?, ?) [["url_id", 3], ["users_group_id", 2]] +  (103.8ms) commit transaction + User Load (0.4ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 17:23:28 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (7.5ms) +Completed 200 OK in 232ms (Views: 209.3ms | ActiveRecord: 0.8ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 17:23:28 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 17:23:28 +0300 +Started GET "/oauth/yandex?code=5106311" for 127.0.0.1 at 2016-05-15 17:23:29 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"5106311", "provider_name"=>"yandex"} + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.3ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "706255cd-0d4f-4cb1-ae95-150151952f43"], ["id", 2]] +  (93.3ms) commit transaction +Completed 200 OK in 267ms (Views: 0.5ms | ActiveRecord: 94.7ms) + User Load (0.6ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 17:23:29 +0300 +Processing by TestController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "706255cd-0d4f-4cb1-ae95-150151952f43"]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "706255cd-0d4f-4cb1-ae95-150151952f43"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Completed 200 OK in 6ms (Views: 0.2ms | ActiveRecord: 0.8ms) +Started GET "/logout" for 127.0.0.1 at 2016-05-15 17:23:30 +0300 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) begin transaction + SQL (0.3ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (98.7ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (97.0ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 3], ["user_group_id", 3]] +  (98.6ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (99.3ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("url_id", "users_group_id") VALUES (?, ?) [["url_id", 4], ["users_group_id", 3]] +  (104.0ms) commit transaction + User Load (0.4ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 17:24:59 +0300 +Processing by LoginController#index as HTML + User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.3ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.3ms) +Completed 200 OK in 257ms (Views: 217.6ms | ActiveRecord: 1.2ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 17:24:59 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 17:24:59 +0300 +Started GET "/oauth/yandex?code=9100043" for 127.0.0.1 at 2016-05-15 17:25:00 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"9100043", "provider_name"=>"yandex"} + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.3ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "cda05035-2eda-4882-981d-179f28230488"], ["id", 2]] +  (99.1ms) commit transaction +Completed 200 OK in 281ms (Views: 0.3ms | ActiveRecord: 100.4ms) + User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 17:25:01 +0300 +Processing by TestController#index as HTML + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "cda05035-2eda-4882-981d-179f28230488"]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "cda05035-2eda-4882-981d-179f28230488"]] + SQL (0.6ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Completed 200 OK in 9ms (Views: 0.3ms | ActiveRecord: 1.0ms) +Started GET "/login/logout" for 127.0.0.1 at 2016-05-15 17:25:01 +0300 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "guest"]] +  (102.9ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"]] +  (101.9ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"]] +  (97.2ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/login/logout"], ["name", "Logout page"], ["http_method", "GET"]] +  (95.4ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Guest"]] +  (99.2ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 4], ["user_group_id", 4]] +  (98.7ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("users_group_id") VALUES (?) [["users_group_id", 4]] +  (85.0ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("users_group_id") VALUES (?) [["users_group_id", 4]] +  (96.6ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("users_group_id") VALUES (?) [["users_group_id", 4]] +  (96.0ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (129.1ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (103.9ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 5], ["user_group_id", 5]] +  (95.7ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 5], ["user_group_id", 4]] +  (96.0ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (138.2ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id", "users_group_id") VALUES (?, ?) [["url_id", 8], ["users_group_id", 5]] +  (96.5ms) commit transaction + User Load (0.4ms) SELECT "users".* FROM "users" +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "guest"]] +  (109.5ms) commit transaction +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"]] +  (102.2ms) commit transaction +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"]] +  (88.8ms) commit transaction +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/login/logout"], ["name", "Logout page"], ["http_method", "GET"]] +  (97.1ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Guest"]] +  (98.8ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 6], ["user_group_id", 6]] +  (98.3ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("users_group_id") VALUES (?) [["users_group_id", 7]] +  (105.4ms) commit transaction +  (0.2ms) begin transaction + SQL (0.3ms) INSERT INTO "users_urls" ("users_group_id") VALUES (?) [["users_group_id", 7]] +  (96.6ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("users_group_id") VALUES (?) [["users_group_id", 7]] +  (96.6ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (96.1ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (95.8ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 7], ["user_group_id", 7]] +  (128.8ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 7], ["user_group_id", 6]] +  (88.4ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (112.0ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("url_id", "users_group_id") VALUES (?, ?) [["url_id", 12], ["users_group_id", 8]] +  (96.3ms) commit transaction + User Load (0.3ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 17:44:32 +0300 +Processing by LoginController#index as HTML + Rendered login/index.html.erb within layouts/application (4.4ms) +Completed 200 OK in 262ms (Views: 261.9ms | ActiveRecord: 0.0ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 17:44:32 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 17:44:32 +0300 +Started GET "/oauth/yandex?code=1942891" for 127.0.0.1 at 2016-05-15 17:44:34 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"1942891", "provider_name"=>"yandex"} + User Load (0.6ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.1ms) begin transaction + SQL (0.3ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "18fd9bd1-b947-42ff-ab6e-03751b7ff4e9"], ["id", 2]] +  (138.5ms) commit transaction +Completed 200 OK in 342ms (Views: 0.5ms | ActiveRecord: 139.3ms) + User Load (0.6ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 17:44:34 +0300 +Processing by TestController#index as HTML + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "18fd9bd1-b947-42ff-ab6e-03751b7ff4e9"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Completed 200 OK in 38ms (Views: 0.2ms | ActiveRecord: 1.3ms) +Started GET "/login/logout" for 127.0.0.1 at 2016-05-15 17:44:34 +0300 +Processing by LoginController#logout as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "18fd9bd1-b947-42ff-ab6e-03751b7ff4e9"]] +  (0.2ms) begin transaction + SQL (0.4ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", nil], ["id", 2]] +  (115.4ms) commit transaction +Completed 200 OK in 121ms (Views: 0.4ms | ActiveRecord: 116.2ms) + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (106.6ms) CREATE TABLE "urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "url_pattern" varchar, "name" varchar, "http_method" varchar)  +  (98.2ms) CREATE TABLE "user_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar) +  (0.2ms) select sqlite_version(*) +  (102.8ms) CREATE INDEX "index_user_groups_on_name" ON "user_groups" ("name") +  (98.7ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "api_code" varchar)  +  (100.0ms) CREATE INDEX "index_users_on_name" ON "users" ("name") +  (106.9ms) CREATE TABLE "users_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_group_id" integer, "user_id" integer)  +  (123.3ms) CREATE TABLE "users_urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "users_group_id" integer, "url_id" integer) +  (96.2ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)  +  (98.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version") +  (0.2ms) SELECT version FROM "schema_migrations" +  (98.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20160514163909') + ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "users" ("name") VALUES (?) [["name", "guest"]] +  (98.3ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"]] +  (98.4ms) commit transaction +  (0.1ms) begin transaction + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"]] +  (98.7ms) commit transaction +  (0.1ms) begin transaction + SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/login/logout"], ["name", "Logout page"], ["http_method", "GET"]] +  (116.8ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Guest"]] +  (124.1ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 1], ["user_group_id", 1]] +  (103.6ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("users_group_id") VALUES (?) [["users_group_id", 1]] +  (118.4ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("users_group_id") VALUES (?) [["users_group_id", 1]] +  (96.0ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("users_group_id") VALUES (?) [["users_group_id", 1]] +  (97.3ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (103.8ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (104.1ms) commit transaction +  (0.2ms) begin transaction + SQL (0.3ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]] +  (96.5ms) commit transaction +  (0.2ms) begin transaction + SQL (0.3ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 1]] +  (402.8ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (112.7ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("url_id", "users_group_id") VALUES (?, ?) [["url_id", 4], ["users_group_id", 2]] +  (129.2ms) commit transaction + User Load (0.5ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 17:46:12 +0300 +Processing by LoginController#index as HTML + User Load (0.6ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.3ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 +Filter chain halted as :check_access rendered or redirected +Completed 403 Forbidden in 24ms (Views: 0.2ms | ActiveRecord: 1.3ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "guest"]] +  (112.4ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"]] +  (107.6ms) commit transaction +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"]] +  (115.0ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/login/logout"], ["name", "Logout page"], ["http_method", "GET"]] +  (95.9ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Guest"]] +  (97.1ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 3], ["user_group_id", 3]] +  (101.4ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("users_group_id") VALUES (?) [["users_group_id", 4]] +  (95.7ms) commit transaction +  (0.2ms) begin transaction + SQL (0.3ms) INSERT INTO "users_urls" ("users_group_id") VALUES (?) [["users_group_id", 4]] +  (122.2ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("users_group_id") VALUES (?) [["users_group_id", 4]] +  (104.9ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (95.9ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (114.3ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 4], ["user_group_id", 4]] +  (112.7ms) commit transaction +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 4], ["user_group_id", 3]] +  (96.8ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (103.6ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("url_id", "users_group_id") VALUES (?, ?) [["url_id", 8], ["users_group_id", 5]] +  (96.0ms) commit transaction + User Load (0.3ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 17:46:56 +0300 +Processing by LoginController#index as HTML + User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.3ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 +Filter chain halted as :check_access rendered or redirected +Completed 403 Forbidden in 31ms (Views: 0.3ms | ActiveRecord: 1.2ms) +  (106.5ms) CREATE TABLE "urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "url_pattern" varchar, "name" varchar, "http_method" varchar)  +  (123.8ms) CREATE TABLE "user_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar) +  (0.2ms) select sqlite_version(*) +  (106.2ms) CREATE INDEX "index_user_groups_on_name" ON "user_groups" ("name") +  (81.8ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "api_code" varchar)  +  (74.9ms) CREATE INDEX "index_users_on_name" ON "users" ("name") +  (106.7ms) CREATE TABLE "users_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_group_id" integer, "user_id" integer)  +  (115.0ms) CREATE TABLE "users_urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "users_group_id" integer, "url_id" integer) +  (121.0ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)  +  (98.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version") +  (0.3ms) SELECT version FROM "schema_migrations" +  (98.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20160514163909') + ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "users" ("name") VALUES (?) [["name", "guest"]] +  (89.4ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"]] +  (73.7ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"]] +  (105.8ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/login/logout"], ["name", "Logout page"], ["http_method", "GET"]] +  (104.1ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Guest"]] +  (97.1ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 1], ["user_group_id", 1]] +  (100.0ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("users_group_id") VALUES (?) [["users_group_id", 1]] +  (120.6ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("users_group_id") VALUES (?) [["users_group_id", 1]] +  (104.4ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("users_group_id") VALUES (?) [["users_group_id", 1]] +  (88.1ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (88.0ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (112.4ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]] +  (122.1ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 1]] +  (96.2ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (120.5ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("url_id", "users_group_id") VALUES (?, ?) [["url_id", 4], ["users_group_id", 2]] +  (137.1ms) commit transaction + User Load (0.4ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 17:48:50 +0300 +Processing by LoginController#index as HTML + User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.3ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 +Filter chain halted as :check_access rendered or redirected +Completed 403 Forbidden in 20ms (Views: 0.3ms | ActiveRecord: 1.0ms) +Started GET "/login" for 127.0.0.1 at 2016-05-15 17:48:58 +0300 +Processing by LoginController#index as HTML + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.6ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 +Filter chain halted as :check_access rendered or redirected +Completed 403 Forbidden in 6ms (Views: 0.9ms | ActiveRecord: 0.7ms) +Started GET "/login" for 127.0.0.1 at 2016-05-15 17:48:58 +0300 +Processing by LoginController#index as HTML + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.3ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 +Filter chain halted as :check_access rendered or redirected +Completed 403 Forbidden in 5ms (Views: 0.9ms | ActiveRecord: 0.4ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.0ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "guest"]] +  (104.3ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"]] +  (97.1ms) commit transaction +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"]] +  (82.2ms) commit transaction +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/login/logout"], ["name", "Logout page"], ["http_method", "GET"]] +  (88.8ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Guest"]] +  (81.2ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 3], ["user_group_id", 3]] +  (83.1ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("users_group_id") VALUES (?) [["users_group_id", 4]] +  (102.5ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("users_group_id") VALUES (?) [["users_group_id", 4]] +  (115.2ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("users_group_id") VALUES (?) [["users_group_id", 4]] +  (102.1ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (104.1ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (105.5ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 4], ["user_group_id", 4]] +  (79.4ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 4], ["user_group_id", 3]] +  (121.8ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (195.3ms) commit transaction +  (0.2ms) begin transaction + SQL (0.6ms) INSERT INTO "users_urls" ("url_id", "users_group_id") VALUES (?, ?) [["url_id", 8], ["users_group_id", 5]] +  (120.6ms) commit transaction + User Load (0.4ms) SELECT "users".* FROM "users" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.0ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "guest"]] +  (89.7ms) commit transaction +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"]] +  (92.4ms) commit transaction +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"]] +  (96.8ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/login/logout"], ["name", "Logout page"], ["http_method", "GET"]] +  (87.7ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Guest"]] +  (97.9ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 5], ["user_group_id", 5]] +  (98.5ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("users_group_id") VALUES (?) [["users_group_id", 7]] +  (103.9ms) commit transaction +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "users_urls" ("users_group_id") VALUES (?) [["users_group_id", 7]] +  (88.8ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("users_group_id") VALUES (?) [["users_group_id", 7]] +  (104.6ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (95.5ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (105.6ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 6], ["user_group_id", 6]] +  (95.5ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 6], ["user_group_id", 5]] +  (96.1ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (103.5ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("url_id", "users_group_id") VALUES (?, ?) [["url_id", 12], ["users_group_id", 8]] +  (103.9ms) commit transaction + User Load (0.4ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 17:50:01 +0300 +Processing by LoginController#index as HTML + User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 +Filter chain halted as :check_access rendered or redirected +Completed 403 Forbidden in 23ms (Views: 0.3ms | ActiveRecord: 1.2ms) +  (85.5ms) CREATE TABLE "urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "url_pattern" varchar, "name" varchar, "http_method" varchar)  +  (115.2ms) CREATE TABLE "user_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar) +  (0.2ms) select sqlite_version(*) +  (117.2ms) CREATE INDEX "index_user_groups_on_name" ON "user_groups" ("name") +  (99.6ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "api_code" varchar)  +  (98.3ms) CREATE INDEX "index_users_on_name" ON "users" ("name") +  (98.3ms) CREATE TABLE "users_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_group_id" integer, "user_id" integer)  +  (98.2ms) CREATE TABLE "users_urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "users_group_id" integer, "url_id" integer) +  (103.9ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)  +  (98.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version") +  (0.3ms) SELECT version FROM "schema_migrations" +  (98.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20160514163909') + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "users" ("name") VALUES (?) [["name", "guest"]] +  (90.2ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"]] +  (85.4ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"]] +  (97.0ms) commit transaction +  (0.3ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/login/logout"], ["name", "Logout page"], ["http_method", "GET"]] +  (104.0ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Guest"]] +  (99.1ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 1], ["user_group_id", 1]] +  (103.0ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("url_id", "users_group_id") VALUES (?, ?) [["url_id", 1], ["users_group_id", 1]] +  (102.1ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id", "users_group_id") VALUES (?, ?) [["url_id", 2], ["users_group_id", 1]] +  (96.4ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id", "users_group_id") VALUES (?, ?) [["url_id", 3], ["users_group_id", 1]] +  (88.6ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (112.5ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (95.8ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]] +  (105.7ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 1]] +  (95.9ms) commit transaction +  (0.2ms) begin transaction + SQL (0.3ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (95.9ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id", "users_group_id") VALUES (?, ?) [["url_id", 4], ["users_group_id", 2]] +  (95.9ms) commit transaction + User Load (0.3ms) SELECT "users".* FROM "users" +Started GET "/login" for 127.0.0.1 at 2016-05-15 17:50:51 +0300 +Processing by LoginController#index as HTML + User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.3ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.4ms) +Completed 200 OK in 270ms (Views: 223.0ms | ActiveRecord: 1.3ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 17:50:51 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 17:50:51 +0300 +Started GET "/oauth/yandex?code=2309039" for 127.0.0.1 at 2016-05-15 17:50:53 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"2309039", "provider_name"=>"yandex"} + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.7ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.1ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "14a77c0a-3c3a-437d-9994-ad253e5988a7"], ["id", 2]] +  (107.0ms) commit transaction +Completed 200 OK in 324ms (Views: 0.5ms | ActiveRecord: 108.8ms) + User Load (0.6ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 17:50:53 +0300 +Processing by TestController#index as HTML + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "14a77c0a-3c3a-437d-9994-ad253e5988a7"]] + SQL (0.5ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Completed 200 OK in 7ms (Views: 0.3ms | ActiveRecord: 0.9ms) +Started GET "/login/logout" for 127.0.0.1 at 2016-05-15 17:50:54 +0300 +Processing by LoginController#logout as HTML + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "14a77c0a-3c3a-437d-9994-ad253e5988a7"]] + SQL (0.3ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Filter chain halted as :check_access rendered or redirected +Completed 401 Unauthorized in 4ms (Views: 0.2ms | ActiveRecord: 0.5ms) + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +Started GET "/login" for 127.0.0.1 at 2016-05-15 17:53:10 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.3ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.2ms) +Completed 200 OK in 289ms (Views: 221.3ms | ActiveRecord: 2.0ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 17:53:10 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 17:53:10 +0300 +Started GET "/oauth/yandex?code=1078236" for 127.0.0.1 at 2016-05-15 17:53:11 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"1078236", "provider_name"=>"yandex"} + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.6ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.6ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "0db4667b-cf16-4fec-96c7-8e76551cab20"], ["id", 2]] +  (112.2ms) commit transaction +Completed 200 OK in 338ms (Views: 0.5ms | ActiveRecord: 114.3ms) + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 17:53:12 +0300 +Processing by TestController#index as HTML + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "0db4667b-cf16-4fec-96c7-8e76551cab20"]] + SQL (0.3ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Completed 200 OK in 7ms (Views: 0.5ms | ActiveRecord: 0.7ms) +Started GET "/login/logout" for 127.0.0.1 at 2016-05-15 17:53:12 +0300 +Processing by LoginController#logout as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "0db4667b-cf16-4fec-96c7-8e76551cab20"]] + SQL (0.8ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Filter chain halted as :check_access rendered or redirected +Completed 401 Unauthorized in 8ms (Views: 0.4ms | ActiveRecord: 1.0ms) + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (107.6ms) CREATE TABLE "urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "url_pattern" varchar, "name" varchar, "http_method" varchar)  +  (100.3ms) CREATE TABLE "user_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar) +  (0.2ms) select sqlite_version(*) +  (98.2ms) CREATE INDEX "index_user_groups_on_name" ON "user_groups" ("name") +  (98.2ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "api_code" varchar)  +  (98.2ms) CREATE INDEX "index_users_on_name" ON "users" ("name") +  (123.0ms) CREATE TABLE "users_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_group_id" integer, "user_id" integer)  +  (132.0ms) CREATE TABLE "users_urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_group_id" integer, "url_id" integer) +  (113.3ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)  +  (98.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version") +  (0.3ms) SELECT version FROM "schema_migrations" +  (108.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20160514163909') + ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +Started GET "/login" for 127.0.0.1 at 2016-05-15 18:36:40 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] +Completed 500 Internal Server Error in 19ms (ActiveRecord: 0.7ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.0ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "guest"]] +  (105.4ms) commit transaction +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"]] +  (97.6ms) commit transaction +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"]] +  (97.7ms) commit transaction +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/login/logout"], ["name", "Logout page"], ["http_method", "GET"]] +  (97.7ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Guest"]] +  (106.4ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 1], ["user_group_id", 1]] +  (98.1ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("url_id", "user_group_id") VALUES (?, ?) [["url_id", 1], ["user_group_id", 1]] +  (127.5ms) commit transaction +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "users_urls" ("url_id", "user_group_id") VALUES (?, ?) [["url_id", 2], ["user_group_id", 1]] +  (113.5ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id", "user_group_id") VALUES (?, ?) [["url_id", 3], ["user_group_id", 1]] +  (104.5ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (96.5ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (104.0ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]] +  (95.8ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 1]] +  (96.2ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (121.7ms) commit transaction +  (0.1ms) begin transaction + SQL (0.3ms) INSERT INTO "users_urls" ("url_id", "user_group_id") VALUES (?, ?) [["url_id", 4], ["user_group_id", 2]] +  (104.9ms) commit transaction + User Load (0.4ms) SELECT "users".* FROM "users" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +Started GET "/login" for 127.0.0.1 at 2016-05-15 18:36:55 +0300 +Processing by LoginController#index as HTML + User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.5ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.7ms) +Completed 200 OK in 260ms (Views: 222.9ms | ActiveRecord: 1.3ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 18:36:55 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 18:36:55 +0300 +Started GET "/oauth/yandex?code=5092590" for 127.0.0.1 at 2016-05-15 18:36:57 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"5092590", "provider_name"=>"yandex"} + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.5ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.1ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "0f0aa28c-db4b-4f38-9c65-f3ae77fe2bfe"], ["id", 2]] +  (108.2ms) commit transaction +Completed 200 OK in 326ms (Views: 0.5ms | ActiveRecord: 109.6ms) + User Load (0.6ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 18:36:57 +0300 +Processing by TestController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "0f0aa28c-db4b-4f38-9c65-f3ae77fe2bfe"]] + SQL (0.5ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Completed 200 OK in 8ms (Views: 0.3ms | ActiveRecord: 0.9ms) +Started GET "/login/logout" for 127.0.0.1 at 2016-05-15 18:36:57 +0300 +Processing by LoginController#logout as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "0f0aa28c-db4b-4f38-9c65-f3ae77fe2bfe"]] + SQL (0.9ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "0f0aa28c-db4b-4f38-9c65-f3ae77fe2bfe"]] +  (0.1ms) begin transaction + SQL (0.3ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", nil], ["id", 2]] +  (115.0ms) commit transaction +Completed 200 OK in 129ms (Views: 0.3ms | ActiveRecord: 116.7ms) + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 18:36:57 +0300 +Processing by TestController#index as HTML + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "0f0aa28c-db4b-4f38-9c65-f3ae77fe2bfe"]] +Completed 500 Internal Server Error in 1ms (ActiveRecord: 0.1ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +Started GET "/login" for 127.0.0.1 at 2016-05-15 18:38:01 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (2.9ms) +Completed 200 OK in 296ms (Views: 224.2ms | ActiveRecord: 2.2ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 18:38:01 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 18:38:01 +0300 +Started GET "/oauth/yandex?code=7841161" for 127.0.0.1 at 2016-05-15 18:38:02 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"7841161", "provider_name"=>"yandex"} + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.6ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "120ceb7b-d82a-4402-9b51-e77d0418df71"], ["id", 2]] +  (99.3ms) commit transaction +Completed 200 OK in 313ms (Views: 0.5ms | ActiveRecord: 101.0ms) + User Load (0.6ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 18:38:03 +0300 +Processing by TestController#index as HTML + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "120ceb7b-d82a-4402-9b51-e77d0418df71"]] + SQL (0.8ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Completed 200 OK in 11ms (Views: 0.3ms | ActiveRecord: 1.2ms) +Started GET "/login/logout" for 127.0.0.1 at 2016-05-15 18:38:03 +0300 +Processing by LoginController#logout as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "120ceb7b-d82a-4402-9b51-e77d0418df71"]] + SQL (0.7ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "120ceb7b-d82a-4402-9b51-e77d0418df71"]] +  (0.1ms) begin transaction + SQL (0.3ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", nil], ["id", 2]] +  (123.8ms) commit transaction +Completed 200 OK in 137ms (Views: 0.3ms | ActiveRecord: 125.3ms) + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 18:38:03 +0300 +Processing by TestController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "120ceb7b-d82a-4402-9b51-e77d0418df71"]] +Completed 500 Internal Server Error in 1ms (ActiveRecord: 0.2ms) +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +Started GET "/login" for 127.0.0.1 at 2016-05-15 18:39:21 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.3ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (2.8ms) +Completed 200 OK in 293ms (Views: 224.0ms | ActiveRecord: 2.1ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 18:39:21 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 18:39:21 +0300 +Started GET "/oauth/yandex?code=2525015" for 127.0.0.1 at 2016-05-15 18:39:22 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"2525015", "provider_name"=>"yandex"} + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.9ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.6ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "fc1e87b2-3f03-462f-9424-7ff6271b1d94"], ["id", 2]] +  (98.0ms) commit transaction +Completed 200 OK in 333ms (Views: 0.6ms | ActiveRecord: 100.3ms) + User Load (0.6ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 18:39:23 +0300 +Processing by TestController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "fc1e87b2-3f03-462f-9424-7ff6271b1d94"]] + SQL (0.5ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Completed 200 OK in 6ms (Views: 0.2ms | ActiveRecord: 0.7ms) +Started GET "/login/logout" for 127.0.0.1 at 2016-05-15 18:39:23 +0300 +Processing by LoginController#logout as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "fc1e87b2-3f03-462f-9424-7ff6271b1d94"]] + SQL (0.9ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 + CACHE (0.1ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "fc1e87b2-3f03-462f-9424-7ff6271b1d94"]] +  (0.2ms) begin transaction + SQL (0.4ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", nil], ["id", 2]] +  (134.7ms) commit transaction +Completed 200 OK in 149ms (Views: 0.4ms | ActiveRecord: 136.5ms) + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 18:39:23 +0300 +Processing by TestController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "fc1e87b2-3f03-462f-9424-7ff6271b1d94"]] +Completed 500 Internal Server Error in 1ms (ActiveRecord: 0.2ms) +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +Started GET "/login" for 127.0.0.1 at 2016-05-15 18:39:55 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (2.4ms) +Completed 200 OK in 284ms (Views: 206.9ms | ActiveRecord: 2.3ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 18:39:55 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 18:39:55 +0300 +Started GET "/oauth/yandex?code=9404540" for 127.0.0.1 at 2016-05-15 18:39:56 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"9404540", "provider_name"=>"yandex"} + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (1.0ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.1ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "7806b053-7042-414a-a357-d8da193ab053"], ["id", 2]] +  (102.8ms) commit transaction +Completed 200 OK in 306ms (Views: 0.6ms | ActiveRecord: 104.9ms) + User Load (0.6ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 18:39:57 +0300 +Processing by TestController#index as HTML + User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "7806b053-7042-414a-a357-d8da193ab053"]] + SQL (0.6ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Completed 200 OK in 10ms (Views: 0.3ms | ActiveRecord: 1.1ms) +Started GET "/login/logout" for 127.0.0.1 at 2016-05-15 18:39:57 +0300 +Processing by LoginController#logout as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "7806b053-7042-414a-a357-d8da193ab053"]] + SQL (0.9ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "7806b053-7042-414a-a357-d8da193ab053"]] +  (0.1ms) begin transaction + SQL (0.4ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", nil], ["id", 2]] +  (142.0ms) commit transaction +Completed 200 OK in 156ms (Views: 0.5ms | ActiveRecord: 143.7ms) + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 18:39:57 +0300 +Processing by TestController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "7806b053-7042-414a-a357-d8da193ab053"]] +Completed 500 Internal Server Error in 1ms (ActiveRecord: 0.2ms) +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +Started GET "/login" for 127.0.0.1 at 2016-05-15 18:42:55 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] +Completed 500 Internal Server Error in 20ms (ActiveRecord: 0.8ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +Started GET "/login" for 127.0.0.1 at 2016-05-15 18:43:53 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] +Completed 500 Internal Server Error in 22ms (ActiveRecord: 0.9ms) +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +Started GET "/login" for 127.0.0.1 at 2016-05-15 18:44:09 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.0ms) +Completed 200 OK in 305ms (Views: 230.3ms | ActiveRecord: 2.3ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 18:44:09 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 18:44:09 +0300 +Started GET "/oauth/yandex?code=9004325" for 127.0.0.1 at 2016-05-15 18:44:10 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"9004325", "provider_name"=>"yandex"} + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.5ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.1ms) begin transaction + SQL (0.4ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "89c463b5-6f8d-4259-9a25-35ff63a442d5"], ["id", 2]] +  (111.9ms) commit transaction +Completed 200 OK in 344ms (Views: 0.5ms | ActiveRecord: 113.3ms) + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 18:44:11 +0300 +Processing by TestController#index as HTML + User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "89c463b5-6f8d-4259-9a25-35ff63a442d5"]] + SQL (0.5ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Completed 200 OK in 8ms (Views: 0.2ms | ActiveRecord: 1.0ms) +Started GET "/login/logout" for 127.0.0.1 at 2016-05-15 18:44:11 +0300 +Processing by LoginController#logout as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "89c463b5-6f8d-4259-9a25-35ff63a442d5"]] + SQL (0.9ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "89c463b5-6f8d-4259-9a25-35ff63a442d5"]] +  (0.1ms) begin transaction + SQL (0.3ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", nil], ["id", 2]] +  (147.2ms) commit transaction +Completed 200 OK in 160ms (Views: 0.5ms | ActiveRecord: 148.8ms) + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 18:44:11 +0300 +Processing by TestController#index as HTML + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.6ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 +Filter chain halted as :check_access rendered or redirected +Completed 403 Forbidden in 6ms (Views: 0.2ms | ActiveRecord: 0.7ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +Started GET "/login" for 127.0.0.1 at 2016-05-15 18:44:43 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.1ms) +Completed 200 OK in 307ms (Views: 229.7ms | ActiveRecord: 2.4ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 18:44:43 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 18:44:43 +0300 +Started GET "/oauth/yandex?code=7959510" for 127.0.0.1 at 2016-05-15 18:44:44 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"7959510", "provider_name"=>"yandex"} + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.1ms) begin transaction + SQL (0.7ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "e379a113-25cb-4240-ae7a-c935ee0849c8"], ["id", 2]] +  (108.2ms) commit transaction +Completed 200 OK in 324ms (Views: 0.4ms | ActiveRecord: 109.8ms) + User Load (0.6ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 18:44:45 +0300 +Processing by TestController#index as HTML + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "e379a113-25cb-4240-ae7a-c935ee0849c8"]] + SQL (0.6ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Completed 200 OK in 8ms (Views: 0.3ms | ActiveRecord: 0.9ms) +Started GET "/login/logout" for 127.0.0.1 at 2016-05-15 18:44:45 +0300 +Processing by LoginController#logout as HTML + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "e379a113-25cb-4240-ae7a-c935ee0849c8"]] + SQL (0.5ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "e379a113-25cb-4240-ae7a-c935ee0849c8"]] +  (0.1ms) begin transaction + SQL (0.2ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", nil], ["id", 2]] +  (121.5ms) commit transaction +Completed 200 OK in 130ms (Views: 0.4ms | ActiveRecord: 122.4ms) + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 18:44:45 +0300 +Processing by TestController#index as HTML + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "e379a113-25cb-4240-ae7a-c935ee0849c8"]] + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.6ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 +Filter chain halted as :check_access rendered or redirected +Completed 401 Unauthorized in 7ms (Views: 0.3ms | ActiveRecord: 0.8ms) +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +Started GET "/login" for 127.0.0.1 at 2016-05-15 18:46:15 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.3ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (2.7ms) +Completed 200 OK in 286ms (Views: 212.8ms | ActiveRecord: 2.0ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 18:46:15 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 18:46:15 +0300 +Started GET "/oauth/yandex?code=9430346" for 127.0.0.1 at 2016-05-15 18:46:16 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"9430346", "provider_name"=>"yandex"} + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.3ms) begin transaction + SQL (0.6ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "bd3a6c24-dd59-45a9-9c96-d6b2a93ea805"], ["id", 2]] +  (106.7ms) commit transaction +Completed 200 OK in 292ms (Views: 0.5ms | ActiveRecord: 108.4ms) + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 18:46:17 +0300 +Processing by TestController#index as HTML + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "bd3a6c24-dd59-45a9-9c96-d6b2a93ea805"]] + SQL (0.6ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Completed 200 OK in 9ms (Views: 0.3ms | ActiveRecord: 1.0ms) +Started GET "/login/logout" for 127.0.0.1 at 2016-05-15 18:46:17 +0300 +Processing by LoginController#logout as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "bd3a6c24-dd59-45a9-9c96-d6b2a93ea805"]] + SQL (0.9ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "bd3a6c24-dd59-45a9-9c96-d6b2a93ea805"]] +  (0.2ms) begin transaction + SQL (0.3ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", nil], ["id", 2]] +  (118.6ms) commit transaction +Completed 200 OK in 133ms (Views: 0.4ms | ActiveRecord: 120.2ms) + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 18:46:17 +0300 +Processing by TestController#index as HTML + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "bd3a6c24-dd59-45a9-9c96-d6b2a93ea805"]] + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.9ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 +Completed 500 Internal Server Error in 12ms (ActiveRecord: 1.1ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +Started GET "/login" for 127.0.0.1 at 2016-05-15 18:47:15 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] +Completed 500 Internal Server Error in 25ms (ActiveRecord: 1.0ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +Started GET "/login" for 127.0.0.1 at 2016-05-15 18:47:29 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.0ms) +Completed 200 OK in 311ms (Views: 232.5ms | ActiveRecord: 2.4ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 18:47:30 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 18:47:30 +0300 +Started GET "/oauth/yandex?code=2257307" for 127.0.0.1 at 2016-05-15 18:47:31 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"2257307", "provider_name"=>"yandex"} + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.5ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.3ms) begin transaction + SQL (0.6ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "4d06f56b-c860-4460-a647-119a20a60310"], ["id", 2]] +  (101.6ms) commit transaction +Completed 200 OK in 442ms (Views: 0.3ms | ActiveRecord: 103.5ms) + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 18:47:31 +0300 +Processing by TestController#index as HTML + User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "4d06f56b-c860-4460-a647-119a20a60310"]] + SQL (0.8ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Completed 200 OK in 10ms (Views: 0.3ms | ActiveRecord: 1.3ms) +Started GET "/login/logout" for 127.0.0.1 at 2016-05-15 18:47:31 +0300 +Processing by LoginController#logout as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "4d06f56b-c860-4460-a647-119a20a60310"]] + SQL (0.9ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "4d06f56b-c860-4460-a647-119a20a60310"]] +  (0.1ms) begin transaction + SQL (0.3ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", nil], ["id", 2]] +  (134.2ms) commit transaction +Completed 200 OK in 148ms (Views: 0.4ms | ActiveRecord: 135.9ms) + User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 18:47:31 +0300 +Processing by TestController#index as HTML + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "4d06f56b-c860-4460-a647-119a20a60310"]] + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.6ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 +Filter chain halted as :check_access rendered or redirected +Completed 403 Forbidden in 7ms (Views: 0.3ms | ActiveRecord: 0.9ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +Started GET "/login" for 127.0.0.1 at 2016-05-15 18:48:37 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.3ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (2.6ms) +Completed 200 OK in 274ms (Views: 213.6ms | ActiveRecord: 1.8ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 18:48:37 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 18:48:37 +0300 +Started GET "/oauth/yandex?code=3181323" for 127.0.0.1 at 2016-05-15 18:48:38 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"3181323", "provider_name"=>"yandex"} + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "2bbe9241-7c59-4bba-bfe7-2311f84575a4"], ["id", 2]] +  (136.4ms) commit transaction +Completed 200 OK in 508ms (Views: 0.6ms | ActiveRecord: 137.8ms) + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 18:48:39 +0300 +Processing by TestController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "2bbe9241-7c59-4bba-bfe7-2311f84575a4"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Completed 200 OK in 6ms (Views: 0.2ms | ActiveRecord: 0.7ms) +Started GET "/login/logout" for 127.0.0.1 at 2016-05-15 18:48:39 +0300 +Processing by LoginController#logout as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "2bbe9241-7c59-4bba-bfe7-2311f84575a4"]] + SQL (0.5ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "2bbe9241-7c59-4bba-bfe7-2311f84575a4"]] +  (0.1ms) begin transaction + SQL (0.2ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", nil], ["id", 2]] +  (90.3ms) commit transaction +Completed 200 OK in 99ms (Views: 0.4ms | ActiveRecord: 91.2ms) + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 18:48:39 +0300 +Processing by TestController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "2bbe9241-7c59-4bba-bfe7-2311f84575a4"]] + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.3ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 +Filter chain halted as :check_access rendered or redirected +Completed 403 Forbidden in 7ms (Views: 0.4ms | ActiveRecord: 0.6ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------- +OauthServiceProviderTest: test_logout +------------------------------------- +Started GET "/login" for 127.0.0.1 at 2016-05-15 18:54:39 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.0ms) +Completed 200 OK in 304ms (Views: 228.1ms | ActiveRecord: 2.3ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 18:54:39 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 18:54:39 +0300 +Started GET "/oauth/yandex?code=9296413" for 127.0.0.1 at 2016-05-15 18:54:41 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"9296413", "provider_name"=>"yandex"} + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.9ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.7ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "dbb91fdc-4f29-4431-8211-c390c6ccd953"], ["id", 2]] +  (214.9ms) commit transaction +Completed 200 OK in 519ms (Views: 0.5ms | ActiveRecord: 217.1ms) + User Load (0.7ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/login/logout" for 127.0.0.1 at 2016-05-15 18:54:41 +0300 +Processing by LoginController#logout as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.8ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 +Completed 400 Bad Request in 10ms (Views: 0.4ms | ActiveRecord: 1.1ms) + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +Started GET "/login" for 127.0.0.1 at 2016-05-15 18:54:41 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.6ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (0.4ms) +Completed 200 OK in 9ms (Views: 2.7ms | ActiveRecord: 1.2ms) +Started GET "/oauth/yandex?code=6240117" for 127.0.0.1 at 2016-05-15 18:54:42 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"6240117", "provider_name"=>"yandex"} + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.8ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.6ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "91b4dcc7-bcfa-4800-83cb-9f4c7a855b7c"], ["id", 2]] +  (95.8ms) commit transaction +Completed 200 OK in 301ms (Views: 0.4ms | ActiveRecord: 97.8ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------- +OauthServiceProviderTest: test_logout +------------------------------------- +Started GET "/login" for 127.0.0.1 at 2016-05-15 18:55:20 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (2.9ms) +Completed 200 OK in 296ms (Views: 220.9ms | ActiveRecord: 2.3ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 18:55:21 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 18:55:21 +0300 +Started GET "/oauth/yandex?code=8860613" for 127.0.0.1 at 2016-05-15 18:55:22 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"8860613", "provider_name"=>"yandex"} + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.1ms) begin transaction + SQL (0.4ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "0f820c62-b2af-4ddc-aab6-951406825f8b"], ["id", 2]] +  (117.5ms) commit transaction +Completed 200 OK in 282ms (Views: 0.3ms | ActiveRecord: 118.5ms) + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/login/logout" for 127.0.0.1 at 2016-05-15 18:55:22 +0300 +Processing by LoginController#logout as HTML + User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "0f820c62-b2af-4ddc-aab6-951406825f8b"]] + SQL (0.8ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "0f820c62-b2af-4ddc-aab6-951406825f8b"]] +  (0.1ms) begin transaction + SQL (0.4ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", nil], ["id", 2]] +  (105.6ms) commit transaction +Completed 200 OK in 120ms (Views: 0.4ms | ActiveRecord: 107.5ms) + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 18:55:22 +0300 +Processing by TestController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "0f820c62-b2af-4ddc-aab6-951406825f8b"]] + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.5ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 +Filter chain halted as :check_access rendered or redirected +Completed 403 Forbidden in 6ms (Views: 0.2ms | ActiveRecord: 0.8ms) +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +Started GET "/login" for 127.0.0.1 at 2016-05-15 18:55:23 +0300 +Processing by LoginController#index as HTML + User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "0f820c62-b2af-4ddc-aab6-951406825f8b"]] + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.8ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (0.5ms) +Completed 200 OK in 15ms (Views: 3.9ms | ActiveRecord: 2.1ms) +Started GET "/oauth/yandex?code=9131796" for 127.0.0.1 at 2016-05-15 18:55:23 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"9131796", "provider_name"=>"yandex"} + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "0f820c62-b2af-4ddc-aab6-951406825f8b"]] + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.8ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "18df6522-b224-470f-873e-2e69c52df8d8"], ["id", 2]] +  (118.0ms) commit transaction +Completed 200 OK in 329ms (Views: 0.5ms | ActiveRecord: 120.1ms) +  (104.5ms) CREATE TABLE "urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "url_pattern" varchar, "name" varchar, "http_method" varchar)  +  (98.2ms) CREATE TABLE "user_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar) +  (0.2ms) select sqlite_version(*) +  (107.7ms) CREATE INDEX "index_user_groups_on_name" ON "user_groups" ("name") +  (98.2ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "api_code" varchar)  +  (98.3ms) CREATE INDEX "index_users_on_name" ON "users" ("name") +  (98.2ms) CREATE TABLE "users_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_group_id" integer, "user_id" integer)  +  (99.1ms) CREATE TABLE "users_urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_group_id" integer, "url_id" integer) +  (96.0ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)  +  (98.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version") +  (0.3ms) SELECT version FROM "schema_migrations" +  (98.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20160514163909') + ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +Started GET "/login" for 127.0.0.1 at 2016-05-15 18:56:55 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] +Completed 500 Internal Server Error in 18ms (ActiveRecord: 0.7ms) +------------------------------------- +OauthServiceProviderTest: test_logout +------------------------------------- +Started GET "/login" for 127.0.0.1 at 2016-05-15 18:56:56 +0300 +Processing by LoginController#index as HTML + User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] +Completed 500 Internal Server Error in 2ms (ActiveRecord: 0.5ms) +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------- +OauthServiceProviderTest: test_logout +------------------------------------- +Started GET "/login" for 127.0.0.1 at 2016-05-15 18:57:13 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] +Completed 500 Internal Server Error in 19ms (ActiveRecord: 0.7ms) +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +Started GET "/login" for 127.0.0.1 at 2016-05-15 18:57:13 +0300 +Processing by LoginController#index as HTML + User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] +Completed 500 Internal Server Error in 2ms (ActiveRecord: 0.5ms) +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +  (0.0ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "guest"]] +  (111.9ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"]] +  (103.1ms) commit transaction +  (0.2ms) begin transaction + SQL (0.3ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"]] +  (96.3ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/login/logout"], ["name", "Logout page"], ["http_method", "GET"]] +  (96.0ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Guest"]] +  (103.2ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 1], ["user_group_id", 1]] +  (99.1ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("url_id", "user_group_id") VALUES (?, ?) [["url_id", 1], ["user_group_id", 1]] +  (96.3ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id", "user_group_id") VALUES (?, ?) [["url_id", 2], ["user_group_id", 1]] +  (96.2ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id", "user_group_id") VALUES (?, ?) [["url_id", 3], ["user_group_id", 1]] +  (97.6ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (95.9ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (96.2ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]] +  (104.1ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 1]] +  (96.2ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (103.6ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id", "user_group_id") VALUES (?, ?) [["url_id", 4], ["user_group_id", 2]] +  (104.0ms) commit transaction +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +Started GET "/login" for 127.0.0.1 at 2016-05-15 18:57:28 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (2.3ms) +Completed 200 OK in 255ms (Views: 235.0ms | ActiveRecord: 0.7ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 18:57:28 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 18:57:28 +0300 +Started GET "/oauth/yandex?code=1056535" for 127.0.0.1 at 2016-05-15 18:57:29 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"1056535", "provider_name"=>"yandex"} + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.8ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.1ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "77972a89-ddbc-4a43-a129-c32fa726cf2f"], ["id", 2]] +  (100.7ms) commit transaction +Completed 200 OK in 325ms (Views: 0.5ms | ActiveRecord: 102.6ms) + User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 18:57:29 +0300 +Processing by TestController#index as HTML + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "77972a89-ddbc-4a43-a129-c32fa726cf2f"]] + SQL (0.7ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Completed 200 OK in 11ms (Views: 0.3ms | ActiveRecord: 1.1ms) +------------------------------------- +OauthServiceProviderTest: test_logout +------------------------------------- +Started GET "/login" for 127.0.0.1 at 2016-05-15 18:57:30 +0300 +Processing by LoginController#index as HTML + User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "77972a89-ddbc-4a43-a129-c32fa726cf2f"]] + SQL (0.9ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 + Rendered login/index.html.erb within layouts/application (0.7ms) +Completed 200 OK in 15ms (Views: 4.4ms | ActiveRecord: 1.3ms) +Started GET "/oauth/yandex?code=9658663" for 127.0.0.1 at 2016-05-15 18:57:30 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"9658663", "provider_name"=>"yandex"} + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "77972a89-ddbc-4a43-a129-c32fa726cf2f"]] + SQL (0.7ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.1ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "1343d271-5b99-4769-b757-250f0d632f78"], ["id", 2]] +  (94.3ms) commit transaction +Completed 200 OK in 383ms (Views: 0.5ms | ActiveRecord: 96.1ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------- +OauthServiceProviderTest: test_logout +------------------------------------- +Started GET "/login" for 127.0.0.1 at 2016-05-15 18:58:14 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.0ms) +Completed 200 OK in 310ms (Views: 232.2ms | ActiveRecord: 2.4ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 18:58:15 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 18:58:15 +0300 +Started GET "/oauth/yandex?code=9008878" for 127.0.0.1 at 2016-05-15 18:58:16 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"9008878", "provider_name"=>"yandex"} + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.7ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.7ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "1b8f99ca-4725-492d-8a1f-6effcfda43b2"], ["id", 2]] +  (178.1ms) commit transaction +Completed 200 OK in 605ms (Views: 0.5ms | ActiveRecord: 180.2ms) + User Load (0.6ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/login/logout" for 127.0.0.1 at 2016-05-15 18:58:17 +0300 +Processing by LoginController#logout as HTML + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "1b8f99ca-4725-492d-8a1f-6effcfda43b2"]] + SQL (0.8ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "1b8f99ca-4725-492d-8a1f-6effcfda43b2"]] +  (0.1ms) begin transaction + SQL (0.3ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", nil], ["id", 2]] +  (107.7ms) commit transaction +Completed 200 OK in 121ms (Views: 0.3ms | ActiveRecord: 109.2ms) + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 18:58:17 +0300 +Processing by TestController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "1b8f99ca-4725-492d-8a1f-6effcfda43b2"]] + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.8ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 +Filter chain halted as :check_access rendered or redirected +Completed 403 Forbidden in 10ms (Views: 0.4ms | ActiveRecord: 1.1ms) +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +Started GET "/login" for 127.0.0.1 at 2016-05-15 18:58:17 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "1b8f99ca-4725-492d-8a1f-6effcfda43b2"]] + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.6ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (0.5ms) +Completed 200 OK in 10ms (Views: 3.2ms | ActiveRecord: 1.0ms) +Started GET "/oauth/yandex?code=3548045" for 127.0.0.1 at 2016-05-15 18:58:17 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"3548045", "provider_name"=>"yandex"} + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "1b8f99ca-4725-492d-8a1f-6effcfda43b2"]] + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.8ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.1ms) begin transaction + SQL (0.3ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "968dcbf4-c4fb-4ea2-899a-90a869511a3b"], ["id", 2]] +  (103.2ms) commit transaction +Completed 200 OK in 325ms (Views: 0.4ms | ActiveRecord: 104.9ms) +Started GET "/login" for 127.0.0.1 at 2016-05-15 18:58:32 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.7ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (0.5ms) +Completed 200 OK in 10ms (Views: 3.2ms | ActiveRecord: 0.9ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 18:58:32 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 18:58:32 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 18:58:32 +0300 +Started GET "/login/logout" for 127.0.0.1 at 2016-05-15 18:58:37 +0300 +Processing by LoginController#logout as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.7ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 +Completed 400 Bad Request in 8ms (Views: 0.3ms | ActiveRecord: 0.9ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +Started GET "/login" for 127.0.0.1 at 2016-05-15 18:58:55 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (2.9ms) +Completed 200 OK in 302ms (Views: 227.8ms | ActiveRecord: 2.2ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 18:58:55 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 18:58:55 +0300 +Started GET "/oauth/yandex?code=2648093" for 127.0.0.1 at 2016-05-15 18:58:56 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"2648093", "provider_name"=>"yandex"} + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.1ms) begin transaction + SQL (0.6ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "6f9baff5-0ab9-4d06-b3eb-87472687cfa4"], ["id", 2]] +  (100.1ms) commit transaction +Completed 200 OK in 309ms (Views: 0.5ms | ActiveRecord: 101.5ms) + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 18:58:57 +0300 +Processing by TestController#index as HTML + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "6f9baff5-0ab9-4d06-b3eb-87472687cfa4"]] + SQL (0.8ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Completed 200 OK in 11ms (Views: 0.3ms | ActiveRecord: 1.2ms) +------------------------------------- +OauthServiceProviderTest: test_logout +------------------------------------- +Started GET "/login" for 127.0.0.1 at 2016-05-15 18:58:57 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "6f9baff5-0ab9-4d06-b3eb-87472687cfa4"]] + SQL (0.7ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 + Rendered login/index.html.erb within layouts/application (0.5ms) +Completed 200 OK in 11ms (Views: 2.5ms | ActiveRecord: 1.5ms) +Started GET "/oauth/yandex?code=3594297" for 127.0.0.1 at 2016-05-15 18:58:57 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"3594297", "provider_name"=>"yandex"} + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "6f9baff5-0ab9-4d06-b3eb-87472687cfa4"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "ae3b0087-610d-4382-9ff5-5922ff6345cf"], ["id", 2]] +  (103.2ms) commit transaction +Completed 200 OK in 374ms (Views: 0.3ms | ActiveRecord: 104.6ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +Started GET "/login" for 127.0.0.1 at 2016-05-15 18:59:57 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.0ms) +Completed 200 OK in 310ms (Views: 232.1ms | ActiveRecord: 2.4ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 18:59:57 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 18:59:57 +0300 +Started GET "/oauth/yandex?code=1084178" for 127.0.0.1 at 2016-05-15 18:59:59 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"1084178", "provider_name"=>"yandex"} + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.5ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.1ms) begin transaction + SQL (0.4ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "279b4997-b9ae-48a0-a8ba-9bb06a9acda2"], ["id", 2]] +  (97.2ms) commit transaction +Completed 200 OK in 275ms (Views: 0.3ms | ActiveRecord: 98.6ms) + User Load (0.6ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 18:59:59 +0300 +Processing by TestController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "279b4997-b9ae-48a0-a8ba-9bb06a9acda2"]] + SQL (0.6ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Completed 200 OK in 8ms (Views: 0.3ms | ActiveRecord: 1.0ms) +------------------------------------- +OauthServiceProviderTest: test_logout +------------------------------------- +Started GET "/login" for 127.0.0.1 at 2016-05-15 18:59:59 +0300 +Processing by LoginController#index as HTML + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "279b4997-b9ae-48a0-a8ba-9bb06a9acda2"]] + SQL (0.9ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 + Rendered login/index.html.erb within layouts/application (0.5ms) +Completed 200 OK in 15ms (Views: 3.9ms | ActiveRecord: 2.0ms) +Started GET "/oauth/yandex?code=5198335" for 127.0.0.1 at 2016-05-15 18:59:59 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"5198335", "provider_name"=>"yandex"} + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "279b4997-b9ae-48a0-a8ba-9bb06a9acda2"]] + SQL (0.9ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.1ms) begin transaction + SQL (0.4ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "b027150c-09fc-40c8-9bae-01eac6bcecf6"], ["id", 2]] +  (95.7ms) commit transaction +Completed 200 OK in 312ms (Views: 0.5ms | ActiveRecord: 97.6ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +Started GET "/login" for 127.0.0.1 at 2016-05-15 19:00:39 +0300 +Processing by LoginController#index as HTML + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (1.9ms) +Completed 200 OK in 244ms (Views: 200.6ms | ActiveRecord: 1.3ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 19:00:39 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 19:00:39 +0300 +Started GET "/oauth/yandex?code=3558188" for 127.0.0.1 at 2016-05-15 19:00:40 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"3558188", "provider_name"=>"yandex"} + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.3ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.7ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "021c97d4-00d9-4cf7-a9f8-6110e443575c"], ["id", 2]] +  (104.1ms) commit transaction +Completed 200 OK in 523ms (Views: 0.5ms | ActiveRecord: 105.8ms) + User Load (0.6ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 19:00:41 +0300 +Processing by TestController#index as HTML + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "021c97d4-00d9-4cf7-a9f8-6110e443575c"]] + SQL (0.7ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Completed 200 OK in 9ms (Views: 0.3ms | ActiveRecord: 1.1ms) +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +------------------------------------- +OauthServiceProviderTest: test_logout +------------------------------------- +Started GET "/login" for 127.0.0.1 at 2016-05-15 19:00:41 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "021c97d4-00d9-4cf7-a9f8-6110e443575c"]] + SQL (0.7ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 + Rendered login/index.html.erb within layouts/application (0.5ms) +Completed 200 OK in 11ms (Views: 3.1ms | ActiveRecord: 0.9ms) +Started GET "/oauth/yandex?code=4138234" for 127.0.0.1 at 2016-05-15 19:00:41 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"4138234", "provider_name"=>"yandex"} + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "021c97d4-00d9-4cf7-a9f8-6110e443575c"]] + SQL (0.9ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.3ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "fb901939-52a8-44b3-9997-428b502a3f7e"], ["id", 2]] +  (118.2ms) commit transaction +Completed 200 OK in 304ms (Views: 0.5ms | ActiveRecord: 120.1ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +Started GET "/login" for 127.0.0.1 at 2016-05-15 19:01:30 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.3ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (2.6ms) +Completed 200 OK in 277ms (Views: 216.2ms | ActiveRecord: 1.8ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 19:01:30 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 19:01:30 +0300 +Started GET "/oauth/yandex?code=2141067" for 127.0.0.1 at 2016-05-15 19:01:31 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"2141067", "provider_name"=>"yandex"} + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.5ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.1ms) begin transaction + SQL (0.4ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "351248fe-ca6f-4d6c-8eb9-7de9907046c0"], ["id", 2]] +  (103.7ms) commit transaction +Completed 200 OK in 282ms (Views: 0.5ms | ActiveRecord: 105.1ms) + User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 19:01:32 +0300 +Processing by TestController#index as HTML + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "351248fe-ca6f-4d6c-8eb9-7de9907046c0"]] + SQL (0.7ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Completed 200 OK in 8ms (Views: 0.2ms | ActiveRecord: 1.0ms) +------------------------------------- +OauthServiceProviderTest: test_logout +------------------------------------- +Started GET "/login" for 127.0.0.1 at 2016-05-15 19:01:32 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "351248fe-ca6f-4d6c-8eb9-7de9907046c0"]] + SQL (0.6ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 + Rendered login/index.html.erb within layouts/application (0.4ms) +Completed 200 OK in 10ms (Views: 2.7ms | ActiveRecord: 1.3ms) +Started GET "/oauth/yandex?code=9845012" for 127.0.0.1 at 2016-05-15 19:01:32 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"9845012", "provider_name"=>"yandex"} + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "351248fe-ca6f-4d6c-8eb9-7de9907046c0"]] + SQL (0.9ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.1ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "71323b3f-8afc-4b7e-a7b5-4c4f2146e6e0"], ["id", 2]] +  (95.3ms) commit transaction +Completed 200 OK in 272ms (Views: 0.5ms | ActiveRecord: 97.3ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +Started GET "/login" for 127.0.0.1 at 2016-05-15 19:02:28 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.1ms) +Completed 200 OK in 298ms (Views: 223.0ms | ActiveRecord: 2.3ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 19:02:28 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 19:02:28 +0300 +Started GET "/oauth/yandex?code=4895791" for 127.0.0.1 at 2016-05-15 19:02:46 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"4895791", "provider_name"=>"yandex"} + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.8ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.6ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "e69687e6-e9bc-4548-b152-f4c40e33913d"], ["id", 2]] +  (103.2ms) commit transaction +Completed 200 OK in 301ms (Views: 0.6ms | ActiveRecord: 105.5ms) + User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 19:02:46 +0300 +Processing by TestController#index as HTML + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "e69687e6-e9bc-4548-b152-f4c40e33913d"]] + SQL (0.6ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Completed 200 OK in 10ms (Views: 0.3ms | ActiveRecord: 1.0ms) +------------------------------------- +OauthServiceProviderTest: test_logout +------------------------------------- +Started GET "/login" for 127.0.0.1 at 2016-05-15 19:02:47 +0300 +Processing by LoginController#index as HTML + User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "e69687e6-e9bc-4548-b152-f4c40e33913d"]] + SQL (0.9ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 + Rendered login/index.html.erb within layouts/application (0.5ms) +Completed 200 OK in 15ms (Views: 3.6ms | ActiveRecord: 1.9ms) +Started GET "/oauth/yandex?code=2581071" for 127.0.0.1 at 2016-05-15 19:02:47 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"2581071", "provider_name"=>"yandex"} + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "e69687e6-e9bc-4548-b152-f4c40e33913d"]] + SQL (0.9ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "e470eceb-d8d4-4e67-ba44-8703cee6cc3b"], ["id", 2]] +  (105.2ms) commit transaction +Completed 200 OK in 314ms (Views: 0.5ms | ActiveRecord: 107.2ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +Started GET "/login" for 127.0.0.1 at 2016-05-15 19:03:07 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.1ms) +Completed 200 OK in 303ms (Views: 224.9ms | ActiveRecord: 2.3ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 19:03:07 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 19:03:08 +0300 +Started GET "/oauth/yandex?code=1717319" for 127.0.0.1 at 2016-05-15 19:03:09 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"1717319", "provider_name"=>"yandex"} + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.9ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "49a27027-03b8-4025-a1b5-4df318286cad"], ["id", 2]] +  (106.0ms) commit transaction +Completed 200 OK in 301ms (Views: 0.6ms | ActiveRecord: 108.0ms) + User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 19:03:09 +0300 +Processing by TestController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "49a27027-03b8-4025-a1b5-4df318286cad"]] + SQL (0.5ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Completed 200 OK in 7ms (Views: 0.2ms | ActiveRecord: 0.8ms) +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +------------------------------------- +OauthServiceProviderTest: test_logout +------------------------------------- +Started GET "/login" for 127.0.0.1 at 2016-05-15 19:03:09 +0300 +Processing by LoginController#index as HTML + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "49a27027-03b8-4025-a1b5-4df318286cad"]] + SQL (0.6ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 + Rendered login/index.html.erb within layouts/application (0.4ms) +Completed 200 OK in 9ms (Views: 3.0ms | ActiveRecord: 0.7ms) +Started GET "/oauth/yandex?code=4979928" for 127.0.0.1 at 2016-05-15 19:03:09 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"4979928", "provider_name"=>"yandex"} + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "49a27027-03b8-4025-a1b5-4df318286cad"]] + SQL (0.7ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.4ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "64177020-d703-49d1-a4ef-80bc88f0e363"], ["id", 2]] +  (104.5ms) commit transaction +Completed 200 OK in 350ms (Views: 0.5ms | ActiveRecord: 106.2ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +Started GET "/login" for 127.0.0.1 at 2016-05-15 19:03:43 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.0ms) +Completed 200 OK in 310ms (Views: 233.1ms | ActiveRecord: 2.3ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 19:03:43 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 19:03:43 +0300 +Started GET "/oauth/yandex?code=9005396" for 127.0.0.1 at 2016-05-15 19:03:45 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"9005396", "provider_name"=>"yandex"} + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.6ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "d621789e-edaf-4afd-8553-4e31f1b3175b"], ["id", 2]] +  (101.3ms) commit transaction +Completed 200 OK in 547ms (Views: 0.5ms | ActiveRecord: 102.6ms) + User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 19:03:45 +0300 +Processing by TestController#index as HTML + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "d621789e-edaf-4afd-8553-4e31f1b3175b"]] + SQL (0.8ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Completed 200 OK in 11ms (Views: 0.4ms | ActiveRecord: 1.2ms) +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +------------------------------------- +OauthServiceProviderTest: test_logout +------------------------------------- + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +Started GET "/login" for 127.0.0.1 at 2016-05-15 19:03:56 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.1ms) +Completed 200 OK in 304ms (Views: 225.8ms | ActiveRecord: 2.3ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 19:03:56 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 19:03:56 +0300 +Started GET "/oauth/yandex?code=6576011" for 127.0.0.1 at 2016-05-15 19:03:58 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"6576011", "provider_name"=>"yandex"} + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.8ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.6ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "79702186-2e66-4b9f-a304-8898ba1e01a4"], ["id", 2]] +  (91.3ms) commit transaction +Completed 200 OK in 290ms (Views: 0.4ms | ActiveRecord: 93.3ms) + User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 19:03:58 +0300 +Processing by TestController#index as HTML + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "79702186-2e66-4b9f-a304-8898ba1e01a4"]] + SQL (0.7ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Completed 200 OK in 10ms (Views: 0.3ms | ActiveRecord: 1.1ms) +------------------------------------- +OauthServiceProviderTest: test_logout +------------------------------------- +Started GET "/login" for 127.0.0.1 at 2016-05-15 19:03:58 +0300 +Processing by LoginController#index as HTML + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "79702186-2e66-4b9f-a304-8898ba1e01a4"]] + SQL (0.5ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 + Rendered login/index.html.erb within layouts/application (0.6ms) +Completed 200 OK in 12ms (Views: 3.5ms | ActiveRecord: 1.3ms) +Started GET "/oauth/yandex?code=2584937" for 127.0.0.1 at 2016-05-15 19:03:58 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"2584937", "provider_name"=>"yandex"} + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "79702186-2e66-4b9f-a304-8898ba1e01a4"]] + SQL (0.8ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.1ms) begin transaction + SQL (0.2ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "07abe4f0-f223-485a-9a79-c1670965a002"], ["id", 2]] +  (106.8ms) commit transaction +Completed 200 OK in 324ms (Views: 0.7ms | ActiveRecord: 108.3ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +Started GET "/login" for 127.0.0.1 at 2016-05-15 19:04:22 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.0ms) +Completed 200 OK in 301ms (Views: 226.5ms | ActiveRecord: 2.3ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 19:04:23 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 19:04:23 +0300 +Started GET "/oauth/yandex?code=3888474" for 127.0.0.1 at 2016-05-15 19:04:24 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"3888474", "provider_name"=>"yandex"} + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.6ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "5de5c7b6-f6b9-4386-b5e5-6cf7abfc297a"], ["id", 2]] +  (107.5ms) commit transaction +Completed 200 OK in 437ms (Views: 0.5ms | ActiveRecord: 109.0ms) + User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 19:04:24 +0300 +Processing by TestController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "5de5c7b6-f6b9-4386-b5e5-6cf7abfc297a"]] + SQL (0.5ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Completed 200 OK in 7ms (Views: 0.3ms | ActiveRecord: 0.9ms) +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +------------------------------------- +OauthServiceProviderTest: test_logout +------------------------------------- +Started GET "/login" for 127.0.0.1 at 2016-05-15 19:04:24 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "5de5c7b6-f6b9-4386-b5e5-6cf7abfc297a"]] + SQL (0.7ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 + Rendered login/index.html.erb within layouts/application (0.6ms) +Completed 200 OK in 12ms (Views: 3.5ms | ActiveRecord: 0.9ms) +Started GET "/oauth/yandex?code=7373077" for 127.0.0.1 at 2016-05-15 19:04:25 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"7373077", "provider_name"=>"yandex"} + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "5de5c7b6-f6b9-4386-b5e5-6cf7abfc297a"]] + SQL (0.5ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.4ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "9b1b4d4a-fa0b-48a3-bfd8-f9447bef2d02"], ["id", 2]] +  (102.2ms) commit transaction +Completed 200 OK in 319ms (Views: 0.4ms | ActiveRecord: 103.8ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_truth +------------------------------------ +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +Started GET "/login" for 127.0.0.1 at 2016-05-15 19:05:13 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.0ms) +Completed 200 OK in 305ms (Views: 228.8ms | ActiveRecord: 2.3ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 19:05:13 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 19:05:13 +0300 +Started GET "/oauth/yandex?code=6712384" for 127.0.0.1 at 2016-05-15 19:05:14 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"6712384", "provider_name"=>"yandex"} + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.9ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "6da1c743-ee33-4bb6-9e90-c8b98c32b9d4"], ["id", 2]] +  (100.3ms) commit transaction +Completed 200 OK in 323ms (Views: 0.5ms | ActiveRecord: 102.4ms) + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 19:05:15 +0300 +Processing by TestController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "6da1c743-ee33-4bb6-9e90-c8b98c32b9d4"]] + SQL (0.5ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Completed 200 OK in 7ms (Views: 0.3ms | ActiveRecord: 0.8ms) +------------------------------------- +OauthServiceProviderTest: test_logout +------------------------------------- +Started GET "/login" for 127.0.0.1 at 2016-05-15 19:05:15 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.6ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (0.4ms) +Completed 200 OK in 9ms (Views: 2.3ms | ActiveRecord: 1.2ms) +Started GET "/oauth/yandex?code=3729323" for 127.0.0.1 at 2016-05-15 19:05:16 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"3729323", "provider_name"=>"yandex"} + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.7ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "ca4bcdf4-1be3-4354-b4ca-52e0d1d8a178"], ["id", 2]] +  (116.0ms) commit transaction +Completed 200 OK in 301ms (Views: 0.6ms | ActiveRecord: 118.0ms) + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/login/logout" for 127.0.0.1 at 2016-05-15 19:05:16 +0300 +Processing by LoginController#logout as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "ca4bcdf4-1be3-4354-b4ca-52e0d1d8a178"]] + SQL (0.6ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "ca4bcdf4-1be3-4354-b4ca-52e0d1d8a178"]] +  (0.1ms) begin transaction + SQL (0.3ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", nil], ["id", 2]] +  (120.8ms) commit transaction +Completed 200 OK in 131ms (Views: 0.4ms | ActiveRecord: 122.1ms) + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 19:05:16 +0300 +Processing by TestController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "ca4bcdf4-1be3-4354-b4ca-52e0d1d8a178"]] + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.6ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 +Filter chain halted as :check_access rendered or redirected +Completed 403 Forbidden in 7ms (Views: 0.2ms | ActiveRecord: 0.9ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +Started GET "/login" for 127.0.0.1 at 2016-05-15 19:07:17 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.0ms) +Completed 200 OK in 307ms (Views: 222.5ms | ActiveRecord: 2.4ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 19:07:17 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 19:07:17 +0300 +Started GET "/oauth/yandex?code=6088918" for 127.0.0.1 at 2016-05-15 19:07:19 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"6088918", "provider_name"=>"yandex"} + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.9ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.1ms) begin transaction + SQL (0.7ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "838c495c-890a-4fbb-887d-a3cefac1cc12"], ["id", 2]] +  (85.8ms) commit transaction +Completed 200 OK in 278ms (Views: 0.6ms | ActiveRecord: 87.9ms) + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 19:07:19 +0300 +Processing by TestController#index as HTML + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "838c495c-890a-4fbb-887d-a3cefac1cc12"]] + SQL (0.7ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Completed 200 OK in 10ms (Views: 0.3ms | ActiveRecord: 1.2ms) +------------------------------------- +OauthServiceProviderTest: test_logout +------------------------------------- +Started GET "/login" for 127.0.0.1 at 2016-05-15 19:07:19 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.5ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (0.4ms) +Completed 200 OK in 10ms (Views: 2.8ms | ActiveRecord: 1.2ms) +Started GET "/oauth/yandex?code=8875563" for 127.0.0.1 at 2016-05-15 19:07:21 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"8875563", "provider_name"=>"yandex"} + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.8ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "a82e26f4-3da2-4f84-b1d8-67510d378175"], ["id", 2]] +  (86.8ms) commit transaction +Completed 200 OK in 303ms (Views: 0.6ms | ActiveRecord: 88.9ms) + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/login/logout" for 127.0.0.1 at 2016-05-15 19:07:21 +0300 +Processing by LoginController#logout as HTML + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "a82e26f4-3da2-4f84-b1d8-67510d378175"]] + SQL (0.9ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "a82e26f4-3da2-4f84-b1d8-67510d378175"]] +  (0.2ms) begin transaction + SQL (0.3ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", nil], ["id", 2]] +  (188.3ms) commit transaction +Completed 200 OK in 202ms (Views: 0.4ms | ActiveRecord: 190.1ms) + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 19:07:21 +0300 +Processing by TestController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "a82e26f4-3da2-4f84-b1d8-67510d378175"]] + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.8ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 +Filter chain halted as :check_access rendered or redirected +Completed 403 Forbidden in 10ms (Views: 0.3ms | ActiveRecord: 1.2ms) +  (128.7ms) CREATE TABLE "urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "url_pattern" varchar, "name" varchar, "http_method" varchar)  +  (98.3ms) CREATE TABLE "user_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar) +  (0.1ms) select sqlite_version(*) +  (131.2ms) CREATE INDEX "index_user_groups_on_name" ON "user_groups" ("name") +  (106.6ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "api_code" varchar)  +  (90.3ms) CREATE INDEX "index_users_on_name" ON "users" ("name") +  (114.9ms) CREATE TABLE "users_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_group_id" integer, "user_id" integer)  +  (123.6ms) CREATE TABLE "users_urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_group_id" integer, "url_id" integer) +  (122.4ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)  +  (123.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version") +  (0.3ms) SELECT version FROM "schema_migrations" +  (123.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20160514163909') + ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users" ("name") VALUES (?) [["name", "guest"]] +  (121.2ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"]] +  (85.7ms) commit transaction +  (0.2ms) begin transaction + SQL (0.3ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"]] +  (96.1ms) commit transaction +  (0.2ms) begin transaction + SQL (0.3ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/login/logout"], ["name", "Logout page"], ["http_method", "GET"]] +  (96.4ms) commit transaction +  (0.1ms) begin transaction + SQL (0.6ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Guest"]] +  (111.2ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 1], ["user_group_id", 1]] +  (108.7ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id", "user_group_id") VALUES (?, ?) [["url_id", 1], ["user_group_id", 1]] +  (104.8ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id", "user_group_id") VALUES (?, ?) [["url_id", 2], ["user_group_id", 1]] +  (113.0ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id", "user_group_id") VALUES (?, ?) [["url_id", 3], ["user_group_id", 1]] +  (113.0ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (105.8ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (95.8ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]] +  (104.1ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 1]] +  (104.5ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (103.6ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id", "user_group_id") VALUES (?, ?) [["url_id", 4], ["user_group_id", 2]] +  (112.3ms) commit transaction +Started GET "/login" for 127.0.0.1 at 2016-05-15 19:12:24 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (2.4ms) +Completed 200 OK in 226ms (Views: 199.9ms | ActiveRecord: 0.7ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 19:12:24 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 19:12:24 +0300 +Started GET "/oauth/yandex?code=6165377" for 127.0.0.1 at 2016-05-15 19:12:26 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"6165377", "provider_name"=>"yandex"} + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.8ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "c62f2193-02cc-4e2f-8174-c7bbf7086f89"], ["id", 2]] +  (110.7ms) commit transaction +Completed 200 OK in 311ms (Views: 0.6ms | ActiveRecord: 112.8ms) + User Load (0.6ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 19:12:26 +0300 +Processing by TestController#index as HTML + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "c62f2193-02cc-4e2f-8174-c7bbf7086f89"]] + SQL (0.8ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Completed 200 OK in 10ms (Views: 0.4ms | ActiveRecord: 1.2ms) +------------------------------------- +OauthServiceProviderTest: test_logout +------------------------------------- +Started GET "/login" for 127.0.0.1 at 2016-05-15 19:12:27 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.8ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (0.5ms) +Completed 200 OK in 13ms (Views: 3.9ms | ActiveRecord: 1.1ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------- +OauthServiceProviderTest: test_logout +------------------------------------- +  (0.0ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "guest"]] +  (110.6ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"]] +  (101.4ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"]] +  (96.4ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/login/logout"], ["name", "Logout page"], ["http_method", "GET"]] +  (79.9ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Guest"]] +  (103.2ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 3], ["user_group_id", 3]] +  (108.8ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("url_id", "user_group_id") VALUES (?, ?) [["url_id", 5], ["user_group_id", 3]] +  (111.1ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id", "user_group_id") VALUES (?, ?) [["url_id", 6], ["user_group_id", 3]] +  (106.1ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id", "user_group_id") VALUES (?, ?) [["url_id", 7], ["user_group_id", 3]] +  (96.0ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (103.7ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (121.1ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 4], ["user_group_id", 4]] +  (104.2ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 4], ["user_group_id", 3]] +  (104.4ms) commit transaction +  (0.3ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (87.2ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id", "user_group_id") VALUES (?, ?) [["url_id", 8], ["user_group_id", 4]] +  (120.7ms) commit transaction +Started GET "/login" for 127.0.0.1 at 2016-05-15 19:13:10 +0300 +Processing by LoginController#index as HTML + User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.7ms) +Completed 200 OK in 274ms (Views: 231.0ms | ActiveRecord: 1.3ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 19:13:11 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 19:13:11 +0300 +Started GET "/oauth/yandex?code=5603163" for 127.0.0.1 at 2016-05-15 19:13:12 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"5603163", "provider_name"=>"yandex"} + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.6ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "c2298fe3-35cf-4204-ba05-9439d3a627fe"], ["id", 2]] +  (103.3ms) commit transaction +Completed 200 OK in 324ms (Views: 0.5ms | ActiveRecord: 104.8ms) + User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/login/logout" for 127.0.0.1 at 2016-05-15 19:13:12 +0300 +Processing by LoginController#logout as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "c2298fe3-35cf-4204-ba05-9439d3a627fe"]] + SQL (0.5ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "c2298fe3-35cf-4204-ba05-9439d3a627fe"]] +  (0.1ms) begin transaction + SQL (0.2ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", nil], ["id", 2]] +  (121.7ms) commit transaction +Completed 200 OK in 132ms (Views: 0.4ms | ActiveRecord: 122.9ms) + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 19:13:13 +0300 +Processing by TestController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "c2298fe3-35cf-4204-ba05-9439d3a627fe"]] + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.6ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 +Filter chain halted as :check_access rendered or redirected +Completed 403 Forbidden in 7ms (Views: 0.3ms | ActiveRecord: 1.0ms) +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +Started GET "/login" for 127.0.0.1 at 2016-05-15 19:13:13 +0300 +Processing by LoginController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.6ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (0.4ms) +Completed 200 OK in 9ms (Views: 2.6ms | ActiveRecord: 0.8ms) +Started GET "/oauth/yandex?code=4768587" for 127.0.0.1 at 2016-05-15 19:13:14 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"4768587", "provider_name"=>"yandex"} + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.9ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "2b34a786-cfcb-41ec-9ee7-94575c4c54a1"], ["id", 2]] +  (108.4ms) commit transaction +Completed 200 OK in 302ms (Views: 0.5ms | ActiveRecord: 110.5ms) + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 19:13:14 +0300 +Processing by TestController#index as HTML + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "2b34a786-cfcb-41ec-9ee7-94575c4c54a1"]] + SQL (0.9ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Completed 200 OK in 9ms (Views: 0.3ms | ActiveRecord: 1.4ms) + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +------------------------------------ +OauthServiceProviderTest: test_login +------------------------------------ +  (0.1ms) begin transaction + SQL (0.2ms) INSERT INTO "users" ("name") VALUES (?) [["name", "guest"]] +  (131.2ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"]] +  (100.4ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"]] +  (104.3ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/login/logout"], ["name", "Logout page"], ["http_method", "GET"]] +  (103.9ms) commit transaction +  (0.1ms) begin transaction + SQL (0.4ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Guest"]] +  (96.4ms) commit transaction +  (0.1ms) begin transaction + SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 5], ["user_group_id", 5]] +  (110.1ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("url_id", "user_group_id") VALUES (?, ?) [["url_id", 9], ["user_group_id", 5]] +  (110.5ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id", "user_group_id") VALUES (?, ?) [["url_id", 10], ["user_group_id", 5]] +  (87.8ms) commit transaction +  (0.2ms) begin transaction + SQL (0.5ms) INSERT INTO "users_urls" ("url_id", "user_group_id") VALUES (?, ?) [["url_id", 11], ["user_group_id", 5]] +  (121.3ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]] +  (120.8ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]] +  (129.1ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 6], ["user_group_id", 6]] +  (120.7ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 6], ["user_group_id", 5]] +  (104.8ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]] +  (105.1ms) commit transaction +  (0.2ms) begin transaction + SQL (0.4ms) INSERT INTO "users_urls" ("url_id", "user_group_id") VALUES (?, ?) [["url_id", 12], ["user_group_id", 6]] +  (104.7ms) commit transaction +Started GET "/login" for 127.0.0.1 at 2016-05-15 19:13:32 +0300 +Processing by LoginController#index as HTML + User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (3.8ms) +Completed 200 OK in 284ms (Views: 239.7ms | ActiveRecord: 1.3ms) +Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for 127.0.0.1 at 2016-05-15 19:13:33 +0300 +Started GET "/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js" for 127.0.0.1 at 2016-05-15 19:13:33 +0300 +Started GET "/oauth/yandex?code=2038643" for 127.0.0.1 at 2016-05-15 19:13:34 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"2038643", "provider_name"=>"yandex"} + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.9ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.3ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "0f71a625-98f1-4d64-ba6a-4e6693cf8d4d"], ["id", 2]] +  (118.3ms) commit transaction +Completed 200 OK in 450ms (Views: 0.5ms | ActiveRecord: 120.5ms) + User Load (0.6ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 19:13:34 +0300 +Processing by TestController#index as HTML + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "0f71a625-98f1-4d64-ba6a-4e6693cf8d4d"]] + SQL (0.9ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 +Completed 200 OK in 11ms (Views: 0.3ms | ActiveRecord: 1.3ms) +------------------------------------- +OauthServiceProviderTest: test_logout +------------------------------------- +Started GET "/login" for 127.0.0.1 at 2016-05-15 19:13:35 +0300 +Processing by LoginController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.7ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + Rendered login/index.html.erb within layouts/application (0.5ms) +Completed 200 OK in 12ms (Views: 3.5ms | ActiveRecord: 1.0ms) +Started GET "/oauth/yandex?code=7338106" for 127.0.0.1 at 2016-05-15 19:13:36 +0300 +Processing by LoginController#oauth_callback as HTML + Parameters: {"code"=>"7338106", "provider_name"=>"yandex"} + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.6ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +  (0.2ms) begin transaction + SQL (0.5ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", "bdbf5d84-e05c-432e-8ccc-d51f2d3df8c5"], ["id", 2]] +  (175.5ms) commit transaction +Completed 200 OK in 647ms (Views: 0.5ms | ActiveRecord: 177.3ms) + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/login/logout" for 127.0.0.1 at 2016-05-15 19:13:37 +0300 +Processing by LoginController#logout as HTML + User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "bdbf5d84-e05c-432e-8ccc-d51f2d3df8c5"]] + SQL (1.0ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2 + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "bdbf5d84-e05c-432e-8ccc-d51f2d3df8c5"]] +  (0.1ms) begin transaction + SQL (0.3ms) UPDATE "users" SET "api_code" = ? WHERE "users"."id" = ? [["api_code", nil], ["id", 2]] +  (168.6ms) commit transaction +Completed 200 OK in 184ms (Views: 0.4ms | ActiveRecord: 170.6ms) + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]] +Started GET "/test" for 127.0.0.1 at 2016-05-15 19:13:37 +0300 +Processing by TestController#index as HTML + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."api_code" = ? LIMIT 1 [["api_code", "bdbf5d84-e05c-432e-8ccc-d51f2d3df8c5"]] + User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]] + SQL (0.9ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1 +Filter chain halted as :check_access rendered or redirected +Completed 403 Forbidden in 10ms (Views: 0.3ms | ActiveRecord: 1.3ms)