diff --git a/.rspec b/.rspec new file mode 100644 index 0000000..6d39aa5 --- /dev/null +++ b/.rspec @@ -0,0 +1,4 @@ +--color +--require spec_helper +--format documentation +--order random diff --git a/Gemfile b/Gemfile index b3ca7be..e18cb53 100644 --- a/Gemfile +++ b/Gemfile @@ -39,10 +39,13 @@ gem 'haml' gem "haml-rails", "~> 0.9" gem 'bootstrap-sass', '~> 3.3.6' gem 'devise' +gem 'rails-controller-testing' group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem 'byebug', platform: :mri + gem 'rspec-rails', '~> 3.5' + gem 'factory_girl_rails' end group :development do diff --git a/Gemfile.lock b/Gemfile.lock index d5d5ac3..b408296 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -62,8 +62,14 @@ GEM railties (>= 4.1.0, < 5.1) responders warden (~> 1.2.3) + diff-lcs (1.3) erubis (2.7.0) execjs (2.7.0) + factory_girl (4.8.0) + activesupport (>= 3.0.0) + factory_girl_rails (4.8.0) + factory_girl (~> 4.8.0) + railties (>= 3.0.0) ffi (1.9.17) globalid (0.3.7) activesupport (>= 4.1.0) @@ -122,6 +128,10 @@ GEM bundler (>= 1.3.0, < 2.0) railties (= 5.0.1) sprockets-rails (>= 2.0.0) + rails-controller-testing (1.0.1) + actionpack (~> 5.x) + actionview (~> 5.x) + activesupport (~> 5.x) rails-dom-testing (2.0.2) activesupport (>= 4.2.0, < 6.0) nokogiri (~> 1.6) @@ -139,6 +149,23 @@ GEM ffi (>= 0.5.0) responders (2.3.0) railties (>= 4.2.0, < 5.1) + rspec-core (3.5.4) + rspec-support (~> 3.5.0) + rspec-expectations (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-mocks (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-rails (3.5.2) + actionpack (>= 3.0) + activesupport (>= 3.0) + railties (>= 3.0) + rspec-core (~> 3.5.0) + rspec-expectations (~> 3.5.0) + rspec-mocks (~> 3.5.0) + rspec-support (~> 3.5.0) + rspec-support (3.5.0) ruby_parser (3.8.4) sexp_processor (~> 4.1) sass (3.4.23) @@ -191,6 +218,7 @@ DEPENDENCIES byebug coffee-rails (~> 4.2) devise + factory_girl_rails haml haml-rails (~> 0.9) jbuilder (~> 2.5) @@ -198,6 +226,8 @@ DEPENDENCIES listen (~> 3.0.5) puma (~> 3.0) rails (~> 5.0.1) + rails-controller-testing + rspec-rails (~> 3.5) sass-rails (~> 5.0) spring spring-watcher-listen (~> 2.0.0) diff --git a/db/development.sqlite3 b/db/development.sqlite3 index 98f2136..0f68919 100644 Binary files a/db/development.sqlite3 and b/db/development.sqlite3 differ diff --git a/db/migrate/20170322044652_add_user_id_to_articles.rb b/db/migrate/20170322044652_add_user_id_to_articles.rb new file mode 100644 index 0000000..971c473 --- /dev/null +++ b/db/migrate/20170322044652_add_user_id_to_articles.rb @@ -0,0 +1,6 @@ +class AddUserIdToArticles < ActiveRecord::Migration[5.0] + def change + add_column :articles, :user_id, :integer + add_index :articles, :user_id + end +end diff --git a/db/schema.rb b/db/schema.rb index 275a41a..da0a1a1 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,13 +10,15 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20170304051347) do +ActiveRecord::Schema.define(version: 20170322044652) do create_table "articles", force: :cascade do |t| t.string "title" t.text "text" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.integer "user_id" + t.index ["user_id"], name: "index_articles_on_user_id" end create_table "comments", force: :cascade do |t| diff --git a/db/test.sqlite3 b/db/test.sqlite3 new file mode 100644 index 0000000..4795025 Binary files /dev/null and b/db/test.sqlite3 differ diff --git a/log/development.log b/log/development.log index 7c20471..0aaa736 100644 --- a/log/development.log +++ b/log/development.log @@ -1517,6 +1517,7 @@ Processing by ArticlesController#create as HTML Completed 200 OK in 29ms (Views: 26.1ms | ActiveRecord: 0.2ms) +<<<<<<< HEAD Started GET "/" for 127.0.0.1 at 2017-02-14 21:29:14 +1100 Started GET "/" for 127.0.0.1 at 2017-02-14 21:29:14 +1100 ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" @@ -1809,6 +1810,12 @@ Completed 200 OK in 38ms (Views: 34.7ms | ActiveRecord: 0.2ms) Started POST "/articles/1/edit" for 127.0.0.1 at 2017-02-14 21:40:48 +1100 ActionController::RoutingError (No route matches [POST] "/articles/1/edit"): +======= +Started GET "/user/signin/" for 127.0.0.1 at 2017-03-04 11:07:55 +1100 + ActiveRecord::SchemaMigration Load (9.4ms) SELECT "schema_migrations".* FROM "schema_migrations" + +ActionController::RoutingError (No route matches [GET] "/user/signin"): +>>>>>>> adding rspec actionpack (5.0.1) lib/action_dispatch/middleware/debug_exceptions.rb:53:in `call' web-console (3.4.0) lib/web_console/middleware.rb:135:in `call_app' @@ -1839,6 +1846,7 @@ puma (3.7.0) lib/puma/thread_pool.rb:120:in `call' puma (3.7.0) lib/puma/thread_pool.rb:120:in `block in spawn_thread' Rendering /Users/arbins/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/actionpack-5.0.1/lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb within rescues/layout Rendering /Users/arbins/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/actionpack-5.0.1/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb +<<<<<<< HEAD Rendered /Users/arbins/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/actionpack-5.0.1/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.5ms) Rendered collection of /Users/arbins/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/actionpack-5.0.1/lib/action_dispatch/middleware/templates/routes/_route.html.erb [9 times] (3.7ms) Rendered /Users/arbins/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/actionpack-5.0.1/lib/action_dispatch/middleware/templates/routes/_table.html.erb (7.7ms) @@ -5403,5 +5411,285 @@ Processing by ArticlesController#index as HTML Article Load (0.2ms) SELECT "articles".* FROM "articles" Rendered articles/index.html.haml within layouts/application (16.7ms) Completed 200 OK in 161ms (Views: 62.5ms | ActiveRecord: 1.0ms) +======= + Rendered /Users/arbins/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/actionpack-5.0.1/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (2.6ms) + Rendered collection of /Users/arbins/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/actionpack-5.0.1/lib/action_dispatch/middleware/templates/routes/_route.html.erb [9 times] (37.7ms) + Rendered /Users/arbins/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/actionpack-5.0.1/lib/action_dispatch/middleware/templates/routes/_table.html.erb (35.5ms) + Rendering /Users/arbins/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/actionpack-5.0.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb + Rendered /Users/arbins/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/actionpack-5.0.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (21.3ms) + Rendered /Users/arbins/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/actionpack-5.0.1/lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb within rescues/layout (260.4ms) +Started GET "/articles/new" for 127.0.0.1 at 2017-03-04 11:08:08 +1100 +Processing by ArticlesController#new as HTML + Rendering articles/new.html.haml within layouts/application + Rendered articles/new.html.haml within layouts/application (76.5ms) +Completed 200 OK in 973ms (Views: 940.6ms | ActiveRecord: 1.1ms) + + +Started GET "/articles" for 127.0.0.1 at 2017-03-04 11:08:12 +1100 +Processing by ArticlesController#index as HTML + Rendering articles/index.html.haml within layouts/application + Article Load (0.6ms) SELECT "articles".* FROM "articles" + Rendered articles/index.html.haml within layouts/application (4.1ms) +Completed 200 OK in 55ms (Views: 28.4ms | ActiveRecord: 0.6ms) +>>>>>>> adding rspec + + + ActiveRecord::SchemaMigration Load (19.5ms) SELECT "schema_migrations".* FROM "schema_migrations" + ActiveRecord::InternalMetadata Load (32.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", :environment], ["LIMIT", 1]] +  (0.1ms) begin transaction +  (0.1ms) commit transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms)  SELECT sql + FROM sqlite_master + WHERE name='index_comments_on_article_id' AND type='index' + UNION ALL + SELECT sql + FROM sqlite_temp_master + WHERE name='index_comments_on_article_id' AND type='index' + +  (0.1ms)  SELECT sql + FROM sqlite_master + WHERE name='index_models_on_reset_password_token' AND type='index' + UNION ALL + SELECT sql + FROM sqlite_temp_master + WHERE name='index_models_on_reset_password_token' AND type='index' + +  (0.1ms)  SELECT sql + FROM sqlite_master + WHERE name='index_models_on_email' AND type='index' + UNION ALL + SELECT sql + FROM sqlite_temp_master + WHERE name='index_models_on_email' AND type='index' + +  (0.1ms)  SELECT sql + FROM sqlite_master + WHERE name='index_users_on_reset_password_token' AND type='index' + UNION ALL + SELECT sql + FROM sqlite_temp_master + WHERE name='index_users_on_reset_password_token' AND type='index' + +  (0.1ms)  SELECT sql + FROM sqlite_master + WHERE name='index_users_on_email' AND type='index' + UNION ALL + SELECT sql + FROM sqlite_temp_master + WHERE name='index_users_on_email' AND type='index' + +Started GET "/user/signin/" for 127.0.0.1 at 2017-03-04 17:32:07 +1100 + ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" + +ActionController::RoutingError (No route matches [GET] "/user/signin"): + +actionpack (5.0.1) lib/action_dispatch/middleware/debug_exceptions.rb:53:in `call' +web-console (3.4.0) lib/web_console/middleware.rb:135:in `call_app' +web-console (3.4.0) lib/web_console/middleware.rb:28:in `block in call' +web-console (3.4.0) lib/web_console/middleware.rb:18:in `catch' +web-console (3.4.0) lib/web_console/middleware.rb:18:in `call' +actionpack (5.0.1) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call' +railties (5.0.1) lib/rails/rack/logger.rb:36:in `call_app' +railties (5.0.1) lib/rails/rack/logger.rb:24:in `block in call' +activesupport (5.0.1) lib/active_support/tagged_logging.rb:69:in `block in tagged' +activesupport (5.0.1) lib/active_support/tagged_logging.rb:26:in `tagged' +activesupport (5.0.1) lib/active_support/tagged_logging.rb:69:in `tagged' +railties (5.0.1) lib/rails/rack/logger.rb:24:in `call' +sprockets-rails (3.2.0) lib/sprockets/rails/quiet_assets.rb:13:in `call' +actionpack (5.0.1) lib/action_dispatch/middleware/request_id.rb:24:in `call' +rack (2.0.1) lib/rack/method_override.rb:22:in `call' +rack (2.0.1) lib/rack/runtime.rb:22:in `call' +activesupport (5.0.1) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call' +actionpack (5.0.1) lib/action_dispatch/middleware/executor.rb:12:in `call' +actionpack (5.0.1) lib/action_dispatch/middleware/static.rb:136:in `call' +rack (2.0.1) lib/rack/sendfile.rb:111:in `call' +railties (5.0.1) lib/rails/engine.rb:522:in `call' +puma (3.7.0) lib/puma/configuration.rb:226:in `call' +puma (3.7.0) lib/puma/server.rb:578:in `handle_request' +puma (3.7.0) lib/puma/server.rb:415:in `process_client' +puma (3.7.0) lib/puma/server.rb:275:in `block in run' +puma (3.7.0) lib/puma/thread_pool.rb:120:in `call' +puma (3.7.0) lib/puma/thread_pool.rb:120:in `block in spawn_thread' + Rendering /Users/arbins/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/actionpack-5.0.1/lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb within rescues/layout + Rendering /Users/arbins/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/actionpack-5.0.1/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb + Rendered /Users/arbins/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/actionpack-5.0.1/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.5ms) + Rendered collection of /Users/arbins/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/actionpack-5.0.1/lib/action_dispatch/middleware/templates/routes/_route.html.erb [32 times] (15.4ms) + Rendered /Users/arbins/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/actionpack-5.0.1/lib/action_dispatch/middleware/templates/routes/_table.html.erb (21.4ms) + Rendering /Users/arbins/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/actionpack-5.0.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb + Rendered /Users/arbins/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/actionpack-5.0.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (18.8ms) + Rendered /Users/arbins/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/actionpack-5.0.1/lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb within rescues/layout (226.3ms) +Started GET "/" for 127.0.0.1 at 2017-03-04 17:32:12 +1100 +Processing by WelcomeController#index as HTML +Completed 401 Unauthorized in 14ms (ActiveRecord: 0.0ms) + + +Started GET "/users/sign_in" for 127.0.0.1 at 2017-03-04 17:32:12 +1100 +Processing by Devise::SessionsController#new as HTML + Rendering devise/sessions/new.html.haml within layouts/application + Rendered devise/shared/_links.html.haml (2.8ms) + Rendered devise/sessions/new.html.haml within layouts/application (37.1ms) +Started GET "/" for 127.0.0.1 at 2017-03-04 17:32:13 +1100 +Processing by WelcomeController#index as HTML +Completed 401 Unauthorized in 1ms (ActiveRecord: 0.0ms) + + +Started GET "/users/sign_in" for 127.0.0.1 at 2017-03-04 17:32:13 +1100 +Processing by Devise::SessionsController#new as HTML + Rendering devise/sessions/new.html.haml within layouts/application + Rendered devise/shared/_links.html.haml (2.0ms) + Rendered devise/sessions/new.html.haml within layouts/application (7.8ms) +Completed 200 OK in 842ms (Views: 841.1ms | ActiveRecord: 0.0ms) + + +Completed 200 OK in 1265ms (Views: 1241.6ms | ActiveRecord: 0.8ms) +Started POST "/users/sign_in" for 127.0.0.1 at 2017-03-04 17:32:27 +1100 +Processing by Devise::SessionsController#create as HTML + Parameters: {"utf8"=>"✓", "authenticity_token"=>"G8170kqMig5LbWSTM9v2WdwXekUar+ydVs6+11ch/q2xGVo6l+6U4vvjHhDBiFF5YzlglaYfUIHo+Q9Qf8qtiw==", "user"=>{"email"=>"shresthaarbin@hotmail.com", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Log in"} + User Load (9.5ms) SELECT "users".* FROM "users" WHERE "users"."email" = ? ORDER BY "users"."id" ASC LIMIT ? [["email", "shresthaarbin@hotmail.com"], ["LIMIT", 1]] +  (0.1ms) begin transaction + SQL (0.4ms) UPDATE "users" SET "current_sign_in_at" = ?, "last_sign_in_at" = ?, "sign_in_count" = ?, "updated_at" = ? WHERE "users"."id" = ? [["current_sign_in_at", 2017-03-04 06:32:27 UTC], ["last_sign_in_at", 2017-03-04 06:19:11 UTC], ["sign_in_count", 5], ["updated_at", 2017-03-04 06:32:27 UTC], ["id", 1]] +  (1.8ms) commit transaction +Redirected to http://localhost:3000/ +Completed 302 Found in 215ms (ActiveRecord: 11.8ms) + + +Started GET "/" for 127.0.0.1 at 2017-03-04 17:32:27 +1100 +Processing by WelcomeController#index as HTML + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT ? [["id", 1], ["LIMIT", 1]] + Rendering welcome/index.html.haml within layouts/application + Rendered welcome/index.html.haml within layouts/application (2.1ms) +Completed 200 OK in 78ms (Views: 50.8ms | ActiveRecord: 0.4ms) + + +Started GET "/articles/new" for 127.0.0.1 at 2017-03-04 17:32:30 +1100 +Processing by ArticlesController#new as HTML + User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT ? [["id", 1], ["LIMIT", 1]] + Rendering articles/new.html.haml within layouts/application + Rendered articles/new.html.haml within layouts/application (17.0ms) +Completed 200 OK in 120ms (Views: 79.9ms | ActiveRecord: 1.2ms) + + +Started GET "/articles" for 127.0.0.1 at 2017-03-04 17:32:31 +1100 +Processing by ArticlesController#index as HTML + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT ? [["id", 1], ["LIMIT", 1]] + Rendering articles/index.html.haml within layouts/application + Article Load (18.1ms) SELECT "articles".* FROM "articles" + Rendered articles/index.html.haml within layouts/application (22.8ms) +Completed 200 OK in 90ms (Views: 67.3ms | ActiveRecord: 18.4ms) + + +Started DELETE "/users/sign_out" for 127.0.0.1 at 2017-03-04 17:32:36 +1100 +Processing by Devise::SessionsController#destroy as HTML + Parameters: {"authenticity_token"=>"TeEaPx84b/imyuseCiZ4RbM90r+hbEBiMmYWYZIlNgtYwPmBsDgRgt//QEQxwvWOjQ2mjOG4slmg3jxAoJyvKA=="} + User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT ? [["id", 1], ["LIMIT", 1]] +  (0.1ms) begin transaction +  (0.0ms) commit transaction +Redirected to http://localhost:3000/ +Completed 302 Found in 24ms (ActiveRecord: 0.6ms) + + +Started GET "/" for 127.0.0.1 at 2017-03-04 17:32:36 +1100 +Processing by WelcomeController#index as HTML +Completed 401 Unauthorized in 1ms (ActiveRecord: 0.0ms) + + +Started GET "/users/sign_in" for 127.0.0.1 at 2017-03-04 17:32:36 +1100 +Processing by Devise::SessionsController#new as HTML + Rendering devise/sessions/new.html.haml within layouts/application + Rendered devise/shared/_links.html.haml (2.8ms) + Rendered devise/sessions/new.html.haml within layouts/application (9.4ms) +Completed 200 OK in 62ms (Views: 61.0ms | ActiveRecord: 0.0ms) + + +  (0.3ms) begin transaction +  (0.1ms) rollback transaction +  (0.1ms) begin transaction +  (0.0ms) rollback transaction +  (0.1ms) begin transaction +  (0.0ms) rollback transaction +  (0.1ms) begin transaction + User Exists (14.5ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "test@jobready.com"], ["LIMIT", 1]] +  (0.1ms) rollback transaction +  (0.6ms) begin transaction + User Exists (0.1ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "test@jobready.com"], ["LIMIT", 1]] +  (0.1ms) rollback transaction +  (0.1ms) begin transaction + User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "test@jobready.com"], ["LIMIT", 1]] +  (0.1ms) rollback transaction +  (0.1ms) begin transaction + User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "test@jobready.com"], ["LIMIT", 1]] + SQL (5.1ms) INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "test@jobready.com"], ["encrypted_password", "$2a$11$r6jwGHWs8QsuFKyGlncyru93GXu/Oit769.txJG2s7OtBVkHMqk7G"], ["created_at", 2017-03-07 05:54:43 UTC], ["updated_at", 2017-03-07 05:54:43 UTC]] +  (34.7ms) commit transaction +  (0.1ms) begin transaction +  (0.1ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +Migrating to AddUserIdToArticles (20170322044652) +  (0.1ms) begin transaction +  (0.6ms) ALTER TABLE "articles" ADD "user_id" integer +  (0.1ms) select sqlite_version(*) +  (0.2ms) CREATE INDEX "index_articles_on_user_id" ON "articles" ("user_id") + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20170322044652"]] +  (3.6ms) commit transaction + ActiveRecord::InternalMetadata Load (0.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", :environment], ["LIMIT", 1]] +  (0.0ms) begin transaction +  (0.0ms) commit transaction + ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms)  SELECT sql + FROM sqlite_master + WHERE name='index_articles_on_user_id' AND type='index' + UNION ALL + SELECT sql + FROM sqlite_temp_master + WHERE name='index_articles_on_user_id' AND type='index' + +  (0.1ms)  SELECT sql + FROM sqlite_master + WHERE name='index_comments_on_article_id' AND type='index' + UNION ALL + SELECT sql + FROM sqlite_temp_master + WHERE name='index_comments_on_article_id' AND type='index' + +  (0.1ms)  SELECT sql + FROM sqlite_master + WHERE name='index_models_on_reset_password_token' AND type='index' + UNION ALL + SELECT sql + FROM sqlite_temp_master + WHERE name='index_models_on_reset_password_token' AND type='index' + +  (0.1ms)  SELECT sql + FROM sqlite_master + WHERE name='index_models_on_email' AND type='index' + UNION ALL + SELECT sql + FROM sqlite_temp_master + WHERE name='index_models_on_email' AND type='index' + +  (0.1ms)  SELECT sql + FROM sqlite_master + WHERE name='index_users_on_reset_password_token' AND type='index' + UNION ALL + SELECT sql + FROM sqlite_temp_master + WHERE name='index_users_on_reset_password_token' AND type='index' + +  (0.1ms)  SELECT sql + FROM sqlite_master + WHERE name='index_users_on_email' AND type='index' + UNION ALL + SELECT sql + FROM sqlite_temp_master + WHERE name='index_users_on_email' AND type='index' + + User Load (2.7ms) SELECT "users".* FROM "users" + Article Load (28.5ms) SELECT "articles".* FROM "articles" + Article Load (0.3ms) SELECT "articles".* FROM "articles" ORDER BY "articles"."id" ASC LIMIT ? [["LIMIT", 1]] +  (0.2ms) begin transaction + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] + SQL (29.5ms) UPDATE "articles" SET "updated_at" = ?, "user_id" = ? WHERE "articles"."id" = ? [["updated_at", 2017-03-22 09:09:28 UTC], ["user_id", 1], ["id", 3]] +  (6.9ms) commit transaction + Article Load (0.2ms) SELECT "articles".* FROM "articles" ORDER BY "articles"."id" ASC LIMIT ? [["LIMIT", 1]] diff --git a/log/test.log b/log/test.log new file mode 100644 index 0000000..9d6373a --- /dev/null +++ b/log/test.log @@ -0,0 +1,693 @@ +  (3.1ms) CREATE TABLE "articles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar, "text" text, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) +  (1.8ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL PRIMARY KEY) +  (0.1ms) SELECT version FROM "schema_migrations" +  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20170214022857') +  (2.5ms) CREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) + ActiveRecord::InternalMetadata Load (0.3ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", :environment], ["LIMIT", 1]] +  (0.1ms) begin transaction + SQL (1.3ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["key", "environment"], ["value", "test"], ["created_at", 2017-02-28 06:03:34 UTC], ["updated_at", 2017-02-28 06:03:34 UTC]] +  (1.4ms) commit transaction + ActiveRecord::InternalMetadata Load (0.1ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", :environment], ["LIMIT", 1]] +  (0.1ms) begin transaction +  (0.0ms) commit transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.1ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.1ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.1ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.1ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.1ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.0ms) rollback transaction +  (0.0ms) begin transaction +  (0.1ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.1ms) rollback transaction +  (0.1ms) begin transaction +  (0.1ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.1ms) rollback transaction +  (0.1ms) begin transaction +  (0.1ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.1ms) rollback transaction +  (0.1ms) begin transaction +  (0.0ms) rollback transaction +  (0.1ms) begin transaction +  (0.0ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.1ms) rollback transaction +  (0.1ms) begin transaction +  (0.0ms) rollback transaction +  (0.0ms) begin transaction +  (0.0ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.0ms) rollback transaction +  (0.1ms) begin transaction +  (0.0ms) rollback transaction +  (0.0ms) begin transaction +  (0.0ms) rollback transaction +  (0.0ms) begin transaction +  (0.0ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.0ms) rollback transaction +  (0.0ms) begin transaction +  (0.0ms) rollback transaction +  (0.0ms) begin transaction +  (0.0ms) rollback transaction +  (0.1ms) begin transaction +  (0.0ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.1ms) rollback transaction +  (0.1ms) begin transaction +  (0.1ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.0ms) rollback transaction +  (0.1ms) begin transaction +  (0.1ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.0ms) rollback transaction +  (0.0ms) begin transaction +  (0.1ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.1ms) rollback transaction +  (0.0ms) begin transaction +  (0.0ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.0ms) rollback transaction +  (0.1ms) begin transaction +  (0.1ms) rollback transaction +  (0.0ms) begin transaction +  (0.0ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.1ms) rollback transaction +  (0.0ms) begin transaction +  (0.0ms) rollback transaction +  (0.0ms) begin transaction +  (0.1ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.0ms) rollback transaction +  (0.0ms) begin transaction +  (0.1ms) rollback transaction +  (0.0ms) begin transaction +  (0.1ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (16.0ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? [["key", :environment]] + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? [["key", :environment]] + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? [["key", :environment]] +  (1.7ms) CREATE TABLE "articles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar, "text" text, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) +  (1.2ms) CREATE TABLE "comments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "commenter" varchar, "body" text, "article_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) +  (0.1ms) select sqlite_version(*) +  (1.2ms) CREATE INDEX "index_comments_on_article_id" ON "comments" ("article_id") +  (1.4ms) CREATE TABLE "models" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar DEFAULT '' NOT NULL, "encrypted_password" varchar DEFAULT '' NOT NULL, "reset_password_token" varchar, "reset_password_sent_at" datetime, "remember_created_at" datetime, "sign_in_count" integer DEFAULT 0 NOT NULL, "current_sign_in_at" datetime, "last_sign_in_at" datetime, "current_sign_in_ip" varchar, "last_sign_in_ip" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) +  (1.2ms) CREATE UNIQUE INDEX "index_models_on_email" ON "models" ("email") +  (0.1ms)  SELECT sql + FROM sqlite_master + WHERE name='index_models_on_email' AND type='index' + UNION ALL + SELECT sql + FROM sqlite_temp_master + WHERE name='index_models_on_email' AND type='index' + +  (1.3ms) CREATE UNIQUE INDEX "index_models_on_reset_password_token" ON "models" ("reset_password_token") +  (1.4ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar DEFAULT '' NOT NULL, "encrypted_password" varchar DEFAULT '' NOT NULL, "given_name" varchar DEFAULT '' NOT NULL, "last_name" varchar DEFAULT '' NOT NULL, "reset_password_token" varchar, "reset_password_sent_at" datetime, "remember_created_at" datetime, "sign_in_count" integer DEFAULT 0 NOT NULL, "current_sign_in_at" datetime, "last_sign_in_at" datetime, "current_sign_in_ip" varchar, "last_sign_in_ip" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) +  (1.3ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email") +  (0.1ms)  SELECT sql + FROM sqlite_master + WHERE name='index_users_on_email' AND type='index' + UNION ALL + SELECT sql + FROM sqlite_temp_master + WHERE name='index_users_on_email' AND type='index' + +  (1.5ms) CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token") +  (1.6ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL PRIMARY KEY) +  (0.1ms) SELECT version FROM "schema_migrations" +  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20170304051347') +  (1.3ms) INSERT INTO schema_migrations (version) VALUES +('20170214022857'), +('20170304001255'); + + +  (1.4ms) CREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) + ActiveRecord::InternalMetadata Load (0.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", :environment], ["LIMIT", 1]] +  (0.0ms) begin transaction + SQL (0.3ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["key", "environment"], ["value", "test"], ["created_at", 2017-03-07 06:20:55 UTC], ["updated_at", 2017-03-07 06:20:55 UTC]] +  (1.4ms) commit transaction + ActiveRecord::InternalMetadata Load (0.1ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", :environment], ["LIMIT", 1]] +  (0.0ms) begin transaction +  (0.0ms) commit 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" + ActiveRecord::SchemaMigration Load (8.9ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.1ms) rollback transaction +  (0.1ms) begin transaction +  (0.1ms) rollback transaction +  (0.0ms) begin transaction +  (0.1ms) rollback transaction +  (0.1ms) begin transaction +  (0.1ms) SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 +  (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" +  (29.1ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? [["key", :environment]] + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? [["key", :environment]] + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? [["key", :environment]] +  (2.5ms) CREATE TABLE "articles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar, "text" text, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "user_id" integer) +  (0.1ms) select sqlite_version(*) +  (1.5ms) CREATE INDEX "index_articles_on_user_id" ON "articles" ("user_id") +  (1.6ms) CREATE TABLE "comments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "commenter" varchar, "body" text, "article_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) +  (1.3ms) CREATE INDEX "index_comments_on_article_id" ON "comments" ("article_id") +  (1.7ms) CREATE TABLE "models" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar DEFAULT '' NOT NULL, "encrypted_password" varchar DEFAULT '' NOT NULL, "reset_password_token" varchar, "reset_password_sent_at" datetime, "remember_created_at" datetime, "sign_in_count" integer DEFAULT 0 NOT NULL, "current_sign_in_at" datetime, "last_sign_in_at" datetime, "current_sign_in_ip" varchar, "last_sign_in_ip" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) +  (1.9ms) CREATE UNIQUE INDEX "index_models_on_email" ON "models" ("email") +  (0.1ms)  SELECT sql + FROM sqlite_master + WHERE name='index_models_on_email' AND type='index' + UNION ALL + SELECT sql + FROM sqlite_temp_master + WHERE name='index_models_on_email' AND type='index' + +  (1.6ms) CREATE UNIQUE INDEX "index_models_on_reset_password_token" ON "models" ("reset_password_token") +  (2.0ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar DEFAULT '' NOT NULL, "encrypted_password" varchar DEFAULT '' NOT NULL, "given_name" varchar DEFAULT '' NOT NULL, "last_name" varchar DEFAULT '' NOT NULL, "reset_password_token" varchar, "reset_password_sent_at" datetime, "remember_created_at" datetime, "sign_in_count" integer DEFAULT 0 NOT NULL, "current_sign_in_at" datetime, "last_sign_in_at" datetime, "current_sign_in_ip" varchar, "last_sign_in_ip" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) +  (1.6ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email") +  (0.1ms)  SELECT sql + FROM sqlite_master + WHERE name='index_users_on_email' AND type='index' + UNION ALL + SELECT sql + FROM sqlite_temp_master + WHERE name='index_users_on_email' AND type='index' + +  (2.2ms) CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token") +  (2.2ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL PRIMARY KEY) +  (0.2ms) SELECT version FROM "schema_migrations" +  (2.2ms) INSERT INTO "schema_migrations" (version) VALUES ('20170322044652') +  (2.1ms) INSERT INTO schema_migrations (version) VALUES +('20170214022857'), +('20170304001255'), +('20170304051347'); + + +  (2.3ms) CREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) + ActiveRecord::InternalMetadata Load (0.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", :environment], ["LIMIT", 1]] +  (0.0ms) begin transaction + SQL (0.3ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["key", "environment"], ["value", "test"], ["created_at", 2017-03-22 04:48:42 UTC], ["updated_at", 2017-03-22 04:48:42 UTC]] +  (2.0ms) commit transaction + ActiveRecord::InternalMetadata Load (0.1ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", :environment], ["LIMIT", 1]] +  (0.1ms) begin transaction +  (0.0ms) commit transaction + ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.0ms) SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 +  (0.1ms) rollback transaction +  (0.0ms) begin transaction +  (0.0ms) rollback transaction +  (0.0ms) begin transaction +  (0.1ms) rollback transaction +  (0.1ms) begin transaction +  (0.0ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.1ms) rollback transaction +  (0.0ms) begin transaction +  (0.1ms) rollback transaction +  (0.1ms) begin transaction +  (0.0ms) rollback transaction +  (0.0ms) begin transaction +  (0.0ms) SAVEPOINT active_record_1 + User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] +  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 +  (0.1ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.0ms) SAVEPOINT active_record_1 + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] +  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 +  (0.1ms) rollback transaction +  (0.1ms) begin transaction + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] +  (0.1ms) rollback transaction +  (0.0ms) begin transaction + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] +  (0.1ms) rollback transaction +  (0.1ms) begin transaction + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] +  (0.0ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] +  (0.1ms) rollback transaction +  (0.0ms) begin transaction + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] +  (0.0ms) rollback transaction +  (0.0ms) begin transaction + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] +  (0.0ms) rollback transaction +  (0.1ms) begin transaction +  (0.1ms) SAVEPOINT active_record_1 + User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "test@jobready.com"], ["LIMIT", 1]] + SQL (0.6ms) INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "test@jobready.com"], ["encrypted_password", "$2a$04$o8eLYqi7Dxu8xHQUGoWa1e1tX.ntw9mmJ9swqYS56AxHSS3huilh2"], ["created_at", 2017-03-22 05:12:54 UTC], ["updated_at", 2017-03-22 05:12:54 UTC]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.5ms) INSERT INTO "articles" ("title", "text", "created_at", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["title", "How to install Factory Girl"], ["text", "Doe"], ["created_at", 2017-03-22 05:12:54 UTC], ["updated_at", 2017-03-22 05:12:54 UTC], ["user_id", 1]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Processing by ArticlesController#show as HTML + Parameters: {"id"=>"1"} +Completed 500 Internal Server Error in 23ms (ActiveRecord: 0.0ms) +  (1.0ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] +  (0.1ms) rollback transaction +  (0.0ms) begin transaction + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] +  (0.0ms) rollback transaction +  (0.0ms) begin transaction + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] +  (0.1ms) rollback transaction +  (0.1ms) begin transaction +  (0.1ms) SAVEPOINT active_record_1 + User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "test@jobready.com"], ["LIMIT", 1]] + SQL (0.4ms) INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "test@jobready.com"], ["encrypted_password", "$2a$04$9CvdvHrk66uwaW8MCGOVfuTV6HEBj7dotpvZwH9B6tXg61ScOohB."], ["created_at", 2017-03-22 05:13:28 UTC], ["updated_at", 2017-03-22 05:13:28 UTC]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.3ms) INSERT INTO "articles" ("title", "text", "created_at", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["title", "How to install Factory Girl"], ["text", "Doe"], ["created_at", 2017-03-22 05:13:28 UTC], ["updated_at", 2017-03-22 05:13:28 UTC], ["user_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +Processing by ArticlesController#show as HTML + Parameters: {"id"=>"1"} +Completed 500 Internal Server Error in 3ms (ActiveRecord: 0.0ms) +  (1.0ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.1ms) SAVEPOINT active_record_1 + User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "test@jobready.com"], ["LIMIT", 1]] + SQL (0.4ms) INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "test@jobready.com"], ["encrypted_password", "$2a$04$tToHxxl4Jv0pa5B35SvbqO2AeRB5gLvXFXocVMpxVFBRoxQ6512lS"], ["created_at", 2017-03-22 05:16:42 UTC], ["updated_at", 2017-03-22 05:16:42 UTC]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.4ms) INSERT INTO "articles" ("title", "text", "created_at", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["title", "How to install Factory Girl"], ["text", "Doe"], ["created_at", 2017-03-22 05:16:42 UTC], ["updated_at", 2017-03-22 05:16:42 UTC], ["user_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +Processing by ArticlesController#show as HTML + Parameters: {"id"=>"1"} +Completed 500 Internal Server Error in 3ms (ActiveRecord: 0.0ms) +  (5.4ms) rollback transaction +  (0.1ms) begin transaction +  (0.1ms) SAVEPOINT active_record_1 + User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "test@jobready.com"], ["LIMIT", 1]] + SQL (0.4ms) INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "test@jobready.com"], ["encrypted_password", "$2a$04$dlEwsVlThqIrh6o8m3b65uobqquLAKg/5l1d1YGRi94A7/m7ougtK"], ["created_at", 2017-03-22 05:16:42 UTC], ["updated_at", 2017-03-22 05:16:42 UTC]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.7ms) rollback transaction +  (0.1ms) begin transaction +  (0.1ms) SAVEPOINT active_record_1 + User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "test@jobready.com"], ["LIMIT", 1]] + SQL (0.4ms) INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "test@jobready.com"], ["encrypted_password", "$2a$04$yh1ocsnJ2fiTD295muC7zuq7a5.oqgntyHciTubX7x7o/Ld0OUEUe"], ["created_at", 2017-03-22 05:16:42 UTC], ["updated_at", 2017-03-22 05:16:42 UTC]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.4ms) rollback transaction +  (0.1ms) begin transaction +  (0.0ms) SAVEPOINT active_record_1 + User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "test@jobready.com"], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "test@jobready.com"], ["encrypted_password", "$2a$04$j144JeklIY1ERDHgqXKf/.Nq6oNupbXj4D3VlUKDk5fGV8aSNqaYO"], ["created_at", 2017-03-22 05:16:42 UTC], ["updated_at", 2017-03-22 05:16:42 UTC]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.5ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.1ms) SAVEPOINT active_record_1 + User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "test@jobready.com"], ["LIMIT", 1]] + SQL (0.4ms) INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "test@jobready.com"], ["encrypted_password", "$2a$04$KeUOURBgZmgXai/eM0SlqOwBcrOmMQKiXxRnco5KW7xG9u.spvKcS"], ["created_at", 2017-03-22 05:17:15 UTC], ["updated_at", 2017-03-22 05:17:15 UTC]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (11.3ms) rollback transaction +  (0.1ms) begin transaction +  (0.1ms) SAVEPOINT active_record_1 + User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "test@jobready.com"], ["LIMIT", 1]] + SQL (0.4ms) INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "test@jobready.com"], ["encrypted_password", "$2a$04$uiQsQ/npAjFHbB9mHFsZHOHSXF6wmHGibmPdastL3MsK3baRZvG5a"], ["created_at", 2017-03-22 05:17:15 UTC], ["updated_at", 2017-03-22 05:17:15 UTC]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.9ms) rollback transaction +  (0.1ms) begin transaction +  (0.0ms) SAVEPOINT active_record_1 + User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "test@jobready.com"], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "test@jobready.com"], ["encrypted_password", "$2a$04$.9ZxxpvyjjYtg30TkWe6jOQbq08/Z27J36RStJce1U12CisAFjeue"], ["created_at", 2017-03-22 05:17:15 UTC], ["updated_at", 2017-03-22 05:17:15 UTC]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.5ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.1ms) rollback transaction +  (0.0ms) begin transaction +  (0.1ms) rollback transaction +  (0.1ms) begin transaction +  (0.0ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.0ms) SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 +  (0.1ms) rollback transaction +  (0.0ms) begin transaction +  (0.0ms) SAVEPOINT active_record_1 +  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 +  (0.0ms) rollback transaction +  (0.0ms) begin transaction +  (0.0ms) SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 +  (0.0ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.1ms) SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 +  (0.1ms) rollback transaction +  (0.1ms) begin transaction +  (0.0ms) SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 +  (0.0ms) rollback transaction +  (0.1ms) begin transaction +  (0.0ms) SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 +  (0.0ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.0ms) SAVEPOINT active_record_1 + User Load (8.8ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] +  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 +  (0.1ms) rollback transaction +  (0.0ms) begin transaction +  (0.0ms) SAVEPOINT active_record_1 + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] +  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 +  (0.0ms) rollback transaction +  (0.0ms) begin transaction +  (0.0ms) SAVEPOINT active_record_1 + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] +  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 +  (0.0ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.0ms) SAVEPOINT active_record_1 + SQL (89.4ms) INSERT INTO "articles" ("title", "text", "created_at", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["title", "How to install Factory Girl"], ["text", "Doe"], ["created_at", 2017-03-22 08:34:46 UTC], ["updated_at", 2017-03-22 08:34:46 UTC], ["user_id", 1]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.9ms) rollback transaction +  (0.1ms) begin transaction +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.4ms) INSERT INTO "articles" ("title", "text", "created_at", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["title", "How to install Factory Girl"], ["text", "Doe"], ["created_at", 2017-03-22 08:34:47 UTC], ["updated_at", 2017-03-22 08:34:47 UTC], ["user_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.5ms) rollback transaction +  (0.0ms) begin transaction +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.3ms) INSERT INTO "articles" ("title", "text", "created_at", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["title", "How to install Factory Girl"], ["text", "Doe"], ["created_at", 2017-03-22 08:34:47 UTC], ["updated_at", 2017-03-22 08:34:47 UTC], ["user_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.7ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.0ms) rollback transaction +  (0.0ms) begin transaction +  (0.0ms) rollback transaction +  (0.0ms) begin transaction +  (0.0ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.4ms) INSERT INTO "articles" ("title", "text", "created_at", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["title", "How to install Factory Girl"], ["text", "Doe"], ["created_at", 2017-03-22 08:38:25 UTC], ["updated_at", 2017-03-22 08:38:25 UTC], ["user_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.8ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.0ms) SAVEPOINT active_record_1 + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] +  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 +  (0.1ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.0ms) SAVEPOINT active_record_1 + User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] +  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 +  (0.1ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.1ms) SAVEPOINT active_record_1 + User Exists (17.0ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "test@jobready.com"], ["LIMIT", 1]] + SQL (1.1ms) INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "test@jobready.com"], ["encrypted_password", "$2a$04$q5HH2mNE2ebvDVxtsScEguX7djFeK/1zCEk0pb1S/38O2/88FpUm6"], ["created_at", 2017-03-22 08:41:00 UTC], ["updated_at", 2017-03-22 08:41:00 UTC]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.5ms) INSERT INTO "articles" ("title", "text", "created_at", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["title", "How to install Factory Girl"], ["text", "Doe"], ["created_at", 2017-03-22 08:41:00 UTC], ["updated_at", 2017-03-22 08:41:00 UTC], ["user_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (1.7ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.1ms) SAVEPOINT active_record_1 + User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "test@jobready.com"], ["LIMIT", 1]] + SQL (0.4ms) INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "test@jobready.com"], ["encrypted_password", "$2a$04$YKr5PMedbO70vt2H21mNg.ZIXXWXYYy4/XMvZ.BkRDjwKq8fMxKVi"], ["created_at", 2017-03-22 08:41:15 UTC], ["updated_at", 2017-03-22 08:41:15 UTC]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.3ms) INSERT INTO "articles" ("title", "text", "created_at", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["title", "How to install Factory Girl"], ["text", "Doe"], ["created_at", 2017-03-22 08:41:15 UTC], ["updated_at", 2017-03-22 08:41:15 UTC], ["user_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (5.3ms) rollback transaction +  (0.1ms) begin transaction +  (0.1ms) SAVEPOINT active_record_1 + User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "test@jobready.com"], ["LIMIT", 1]] + SQL (0.4ms) INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "test@jobready.com"], ["encrypted_password", "$2a$04$6v/od/aEQQF113agwdO58OLt3SjgkCGXWl5EGGGHPzFDgQZd5h8De"], ["created_at", 2017-03-22 08:41:15 UTC], ["updated_at", 2017-03-22 08:41:15 UTC]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.4ms) INSERT INTO "articles" ("title", "text", "created_at", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["title", "How to install Factory Girl"], ["text", "Doe"], ["created_at", 2017-03-22 08:41:15 UTC], ["updated_at", 2017-03-22 08:41:15 UTC], ["user_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +Processing by ArticlesController#show as HTML + Parameters: {"id"=>"1"} +Completed 500 Internal Server Error in 31ms (ActiveRecord: 0.0ms) +  (2.4ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.1ms) SAVEPOINT active_record_1 + User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "test@jobready.com"], ["LIMIT", 1]] + SQL (0.4ms) INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "test@jobready.com"], ["encrypted_password", "$2a$04$G9CLwjzSuTyq/IB/gJb/GuFDmuW3wUdJaabMPX97jv.iU1jk.5.ou"], ["created_at", 2017-03-22 08:44:53 UTC], ["updated_at", 2017-03-22 08:44:53 UTC]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.3ms) INSERT INTO "articles" ("title", "text", "created_at", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["title", "How to install Factory Girl"], ["text", "Doe"], ["created_at", 2017-03-22 08:44:53 UTC], ["updated_at", 2017-03-22 08:44:53 UTC], ["user_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +Processing by ArticlesController#show as HTML + Parameters: {"id"=>"1"} +Completed 401 Unauthorized in 25ms (ActiveRecord: 0.0ms) +  (2.2ms) rollback transaction +  (0.1ms) begin transaction +  (0.1ms) SAVEPOINT active_record_1 + User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "test@jobready.com"], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "test@jobready.com"], ["encrypted_password", "$2a$04$M91TRvkWQSnx.vXL57/GiujZo8YP75Qr9P98oJb4M8Qjbbm8L0ml."], ["created_at", 2017-03-22 08:44:53 UTC], ["updated_at", 2017-03-22 08:44:53 UTC]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.3ms) INSERT INTO "articles" ("title", "text", "created_at", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["title", "How to install Factory Girl"], ["text", "Doe"], ["created_at", 2017-03-22 08:44:53 UTC], ["updated_at", 2017-03-22 08:44:53 UTC], ["user_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (1.0ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.0ms) rollback transaction +  (0.0ms) begin transaction +  (0.1ms) SAVEPOINT active_record_1 + User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "test@jobready.com"], ["LIMIT", 1]] + SQL (0.5ms) INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "test@jobready.com"], ["encrypted_password", "$2a$04$xsOU6aqIcEi1SpDx1J0tROSIWaDhj9xRqcZ9yUGqJPeEeNCiWFbES"], ["created_at", 2017-03-22 08:50:58 UTC], ["updated_at", 2017-03-22 08:50:58 UTC]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.5ms) INSERT INTO "articles" ("title", "text", "created_at", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["title", "How to install Factory Girl"], ["text", "Doe"], ["created_at", 2017-03-22 08:50:58 UTC], ["updated_at", 2017-03-22 08:50:58 UTC], ["user_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (1.2ms) rollback transaction +  (0.0ms) begin transaction +  (0.1ms) SAVEPOINT active_record_1 + User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "test@jobready.com"], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "test@jobready.com"], ["encrypted_password", "$2a$04$KEdS7nXZ5/cmMYGl5H.TjeYOMBYwj5iZI58oT5gc97UGILvb.Ud2m"], ["created_at", 2017-03-22 08:50:58 UTC], ["updated_at", 2017-03-22 08:50:58 UTC]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.3ms) INSERT INTO "articles" ("title", "text", "created_at", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["title", "How to install Factory Girl"], ["text", "Doe"], ["created_at", 2017-03-22 08:50:58 UTC], ["updated_at", 2017-03-22 08:50:58 UTC], ["user_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +Processing by ArticlesController#show as HTML + Parameters: {"id"=>"1"} +Completed 500 Internal Server Error in 3ms (ActiveRecord: 0.0ms) +  (1.0ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.1ms) SAVEPOINT active_record_1 + User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "test@jobready.com"], ["LIMIT", 1]] + SQL (1.0ms) INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "test@jobready.com"], ["encrypted_password", "$2a$04$5M.60DaWw1.lE5LxjrX5A.MTVtmOGrRSDF0KpziOmN1.1N/B2CRIq"], ["created_at", 2017-03-22 08:51:47 UTC], ["updated_at", 2017-03-22 08:51:47 UTC]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.5ms) INSERT INTO "articles" ("title", "text", "created_at", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["title", "How to install Factory Girl"], ["text", "Doe"], ["created_at", 2017-03-22 08:51:47 UTC], ["updated_at", 2017-03-22 08:51:47 UTC], ["user_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +Processing by ArticlesController#show as HTML + Parameters: {"id"=>"1"} +Completed 500 Internal Server Error in 3ms (ActiveRecord: 0.0ms) +  (1.5ms) rollback transaction +  (0.1ms) begin transaction +  (0.0ms) SAVEPOINT active_record_1 + User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "test@jobready.com"], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "test@jobready.com"], ["encrypted_password", "$2a$04$9I0PckfTT0/T9VJRLIzkBuI9pVxTFarwirsiqqi2guFpmvBVYUS6O"], ["created_at", 2017-03-22 08:51:47 UTC], ["updated_at", 2017-03-22 08:51:47 UTC]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.4ms) INSERT INTO "articles" ("title", "text", "created_at", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["title", "How to install Factory Girl"], ["text", "Doe"], ["created_at", 2017-03-22 08:51:47 UTC], ["updated_at", 2017-03-22 08:51:47 UTC], ["user_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.9ms) rollback transaction +  (0.1ms) begin transaction +  (0.0ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (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" +  (0.1ms) begin transaction +  (0.1ms) SAVEPOINT active_record_1 + User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "test@jobready.com"], ["LIMIT", 1]] + SQL (0.4ms) INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "test@jobready.com"], ["encrypted_password", "$2a$04$r4YQzyj/zoQmXV/fAJpW/OqnDQq1NEQrZD6m/7bBwqILeoA5c9NKC"], ["created_at", 2017-03-22 08:55:49 UTC], ["updated_at", 2017-03-22 08:55:49 UTC]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.6ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.1ms) SAVEPOINT active_record_1 + User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "test@jobready.com"], ["LIMIT", 1]] + SQL (0.4ms) INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "test@jobready.com"], ["encrypted_password", "$2a$04$zlfYDlxF6lH74QDuyLwhKO92bR/sWkwCnJUbUboi0yMrvw7CzY5ka"], ["created_at", 2017-03-22 08:56:04 UTC], ["updated_at", 2017-03-22 08:56:04 UTC]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.8ms) rollback transaction +  (0.1ms) begin transaction +  (0.0ms) SAVEPOINT active_record_1 + User Exists (0.1ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "test@jobready.com"], ["LIMIT", 1]] + SQL (0.4ms) INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "test@jobready.com"], ["encrypted_password", "$2a$04$d5SLNdBaRb9K22uL93wsRunp3kfMzGS7o27Q4Svyc/fvTVslJDfM2"], ["created_at", 2017-03-22 08:56:04 UTC], ["updated_at", 2017-03-22 08:56:04 UTC]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.4ms) INSERT INTO "articles" ("title", "text", "created_at", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["title", "How to install Factory Girl"], ["text", "Doe"], ["created_at", 2017-03-22 08:56:04 UTC], ["updated_at", 2017-03-22 08:56:04 UTC], ["user_id", 1]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (1.1ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.1ms) SAVEPOINT active_record_1 + User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "test@jobready.com"], ["LIMIT", 1]] + SQL (0.5ms) INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "test@jobready.com"], ["encrypted_password", "$2a$04$CFzGU6GjhGPT068XrmSu6OjBUxEfxSHorL39LWc08hhCTU0ASy3p6"], ["created_at", 2017-03-22 09:08:03 UTC], ["updated_at", 2017-03-22 09:08:03 UTC]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.5ms) INSERT INTO "articles" ("title", "text", "created_at", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["title", "How to install Factory Girl"], ["text", "Doe"], ["created_at", 2017-03-22 09:08:03 UTC], ["updated_at", 2017-03-22 09:08:03 UTC], ["user_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (1.3ms) rollback transaction +  (0.1ms) begin transaction +  (0.1ms) SAVEPOINT active_record_1 + User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "test@jobready.com"], ["LIMIT", 1]] + SQL (0.4ms) INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "test@jobready.com"], ["encrypted_password", "$2a$04$tQ39LiRO16pe3q8SzYoT1OFhJheuexSkqF.Q.umrnqNWlYrBwvgjG"], ["created_at", 2017-03-22 09:08:03 UTC], ["updated_at", 2017-03-22 09:08:03 UTC]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.3ms) INSERT INTO "articles" ("title", "text", "created_at", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["title", "How to install Factory Girl"], ["text", "Doe"], ["created_at", 2017-03-22 09:08:03 UTC], ["updated_at", 2017-03-22 09:08:03 UTC], ["user_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +Processing by ArticlesController#show as HTML + Parameters: {"id"=>"1"} +Completed 500 Internal Server Error in 20ms (ActiveRecord: 0.0ms) +  (2.0ms) rollback transaction +  (0.1ms) begin transaction +  (0.0ms) SAVEPOINT active_record_1 + User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "test@jobready.com"], ["LIMIT", 1]] + SQL (0.4ms) INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "test@jobready.com"], ["encrypted_password", "$2a$04$qwjA.EuRTUJ1Jt6aC22CyO393gDJ0veTudjNsoWu9PTrHTQN8qAna"], ["created_at", 2017-03-22 09:08:03 UTC], ["updated_at", 2017-03-22 09:08:03 UTC]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.9ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.1ms) SAVEPOINT active_record_1 + User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "test@jobready.com"], ["LIMIT", 1]] + SQL (0.4ms) INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "test@jobready.com"], ["encrypted_password", "$2a$04$qkpoEbfX0ThgQM7XuPXlAeGvKxKkLpNb5uNWw4vSPOD3ViGWrnQBO"], ["created_at", 2017-03-22 09:09:41 UTC], ["updated_at", 2017-03-22 09:09:41 UTC]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.7ms) rollback transaction +  (0.1ms) begin transaction +  (0.1ms) SAVEPOINT active_record_1 + User Exists (0.1ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "test@jobready.com"], ["LIMIT", 1]] + SQL (0.4ms) INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "test@jobready.com"], ["encrypted_password", "$2a$04$oLa4Bz3/uggXARW/JgxrkubVhAzhrk9/HijGVOI8MCmwasdfodIGC"], ["created_at", 2017-03-22 09:09:41 UTC], ["updated_at", 2017-03-22 09:09:41 UTC]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.4ms) INSERT INTO "articles" ("title", "text", "created_at", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["title", "How to install Factory Girl"], ["text", "Doe"], ["created_at", 2017-03-22 09:09:41 UTC], ["updated_at", 2017-03-22 09:09:41 UTC], ["user_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +Processing by ArticlesController#show as HTML + Parameters: {"id"=>"1"} +Completed 500 Internal Server Error in 3ms (ActiveRecord: 0.0ms) +  (1.0ms) rollback transaction +  (0.0ms) begin transaction +  (0.0ms) SAVEPOINT active_record_1 + User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "test@jobready.com"], ["LIMIT", 1]] + SQL (0.4ms) INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "test@jobready.com"], ["encrypted_password", "$2a$04$r0BK8ano.RcmwjPMCf3ZmOUokkaPPJuJsnVWe2zzNKmvZx/2nDHYS"], ["created_at", 2017-03-22 09:09:41 UTC], ["updated_at", 2017-03-22 09:09:41 UTC]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.4ms) INSERT INTO "articles" ("title", "text", "created_at", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["title", "How to install Factory Girl"], ["text", "Doe"], ["created_at", 2017-03-22 09:09:41 UTC], ["updated_at", 2017-03-22 09:09:41 UTC], ["user_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (1.4ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.1ms) SAVEPOINT active_record_1 + User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "test@jobready.com"], ["LIMIT", 1]] + SQL (0.4ms) INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "test@jobready.com"], ["encrypted_password", "$2a$04$Tg.G0wrD.vxljrjyIjcWtub7QR/go6JGFPVKhcMBnsOZbKiWgaU9q"], ["created_at", 2017-03-22 09:10:14 UTC], ["updated_at", 2017-03-22 09:10:14 UTC]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.4ms) INSERT INTO "articles" ("title", "text", "created_at", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["title", "How to install Factory Girl"], ["text", "Doe"], ["created_at", 2017-03-22 09:10:14 UTC], ["updated_at", 2017-03-22 09:10:14 UTC], ["user_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (1.0ms) rollback transaction +  (0.1ms) begin transaction +  (0.1ms) SAVEPOINT active_record_1 + User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "test@jobready.com"], ["LIMIT", 1]] + SQL (0.4ms) INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "test@jobready.com"], ["encrypted_password", "$2a$04$QCjt/SfoJSuwjvRzyRBs4u3hes3yM2/aMDvZAwzrG.kUQEouniaQm"], ["created_at", 2017-03-22 09:10:15 UTC], ["updated_at", 2017-03-22 09:10:15 UTC]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.4ms) INSERT INTO "articles" ("title", "text", "created_at", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["title", "How to install Factory Girl"], ["text", "Doe"], ["created_at", 2017-03-22 09:10:15 UTC], ["updated_at", 2017-03-22 09:10:15 UTC], ["user_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +Processing by ArticlesController#show as HTML + Parameters: {"id"=>"1"} +Completed 401 Unauthorized in 9ms (ActiveRecord: 0.0ms) +  (1.9ms) rollback transaction +  (0.1ms) begin transaction +  (0.0ms) SAVEPOINT active_record_1 + User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "test@jobready.com"], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "test@jobready.com"], ["encrypted_password", "$2a$04$.1dmP1ypSO9XruqfIT3GUuvkaTHsKMJa9hNu4R4lEK1lsmkPEHWGC"], ["created_at", 2017-03-22 09:10:15 UTC], ["updated_at", 2017-03-22 09:10:15 UTC]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.6ms) rollback transaction + ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations" +  (0.1ms) begin transaction +  (0.1ms) SAVEPOINT active_record_1 + User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "test@jobready.com"], ["LIMIT", 1]] + SQL (0.4ms) INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "test@jobready.com"], ["encrypted_password", "$2a$04$iwwn17m11fveYg1mLKuxLe29xsSRxuYPIxy6ofGVTE5wFdXt4GZ4q"], ["created_at", 2017-03-22 09:11:15 UTC], ["updated_at", 2017-03-22 09:11:15 UTC]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.6ms) INSERT INTO "articles" ("title", "text", "created_at", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["title", "How to install Factory Girl"], ["text", "Doe"], ["created_at", 2017-03-22 09:11:15 UTC], ["updated_at", 2017-03-22 09:11:15 UTC], ["user_id", 1]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +Processing by ArticlesController#show as HTML + Parameters: {"id"=>"1"} +Completed 401 Unauthorized in 8ms (ActiveRecord: 0.0ms) +  (1.8ms) rollback transaction +  (0.1ms) begin transaction +  (0.0ms) SAVEPOINT active_record_1 + User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "test@jobready.com"], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "test@jobready.com"], ["encrypted_password", "$2a$04$2UqZ5BoodbknM3HAL1rP0.xTCVcnBenxGYKspCpeIuE3b/4iKE3fS"], ["created_at", 2017-03-22 09:11:15 UTC], ["updated_at", 2017-03-22 09:11:15 UTC]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.4ms) INSERT INTO "articles" ("title", "text", "created_at", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?) [["title", "How to install Factory Girl"], ["text", "Doe"], ["created_at", 2017-03-22 09:11:15 UTC], ["updated_at", 2017-03-22 09:11:15 UTC], ["user_id", 1]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.9ms) rollback transaction +  (0.1ms) begin transaction +  (0.0ms) SAVEPOINT active_record_1 + User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "test@jobready.com"], ["LIMIT", 1]] + SQL (0.3ms) INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "test@jobready.com"], ["encrypted_password", "$2a$04$uO761p/iCdDUzE2A6Uhx0OqIGIT2cf1NI.L9L0/e9p6qB1R.FODxS"], ["created_at", 2017-03-22 09:11:15 UTC], ["updated_at", 2017-03-22 09:11:15 UTC]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.8ms) rollback transaction diff --git a/spec/controllers/articles_controller_spec.rb b/spec/controllers/articles_controller_spec.rb new file mode 100644 index 0000000..4f1491e --- /dev/null +++ b/spec/controllers/articles_controller_spec.rb @@ -0,0 +1,10 @@ +require 'rails_helper' +RSpec.describe ArticlesController, type: :controller do + describe 'GET #show' do + it "assigns the requested articles to @article" do + article = create(:article) + get :show, id: article + expect(assigns(:article)).to eq article + end + end +end diff --git a/spec/factories/articles.rb b/spec/factories/articles.rb new file mode 100644 index 0000000..01e290d --- /dev/null +++ b/spec/factories/articles.rb @@ -0,0 +1,7 @@ +FactoryGirl.define do + factory :article do + association :user + title "How to install Factory Girl" + text "Doe" + end +end \ No newline at end of file diff --git a/spec/factories/users.rb b/spec/factories/users.rb new file mode 100644 index 0000000..6017e41 --- /dev/null +++ b/spec/factories/users.rb @@ -0,0 +1,6 @@ +FactoryGirl.define do + factory :user do + email "test@jobready.com" + password "123546" + end +end \ No newline at end of file diff --git a/spec/models/article_spec.rb b/spec/models/article_spec.rb new file mode 100644 index 0000000..43c9c55 --- /dev/null +++ b/spec/models/article_spec.rb @@ -0,0 +1,19 @@ +require 'rails_helper' + +RSpec.describe Article, type: :model do + it 'is valid with more than 5 characters' do + article = create(:article) + expect(article).to be_valid + end + # it 'is not valid with less than 5 characters' do + # article = create(:article) + # expect(article).to_not be_valid + # end + + # it 'is invalid without a title' do + # article = create(:article) + # article.valid? + # expect(article.errors.messages[:title]).to include("can't be blank") + # end + +end diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb new file mode 100644 index 0000000..ba3b167 --- /dev/null +++ b/spec/models/user_spec.rb @@ -0,0 +1,8 @@ +require 'spec_helper' + +RSpec.describe User, type: :model do + it "should create a new instance of a user given valid attributes" do + user = create(:user) + expect(user).to be_valid + end +end \ No newline at end of file diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb new file mode 100644 index 0000000..954c9db --- /dev/null +++ b/spec/rails_helper.rb @@ -0,0 +1,60 @@ +# This file is copied to spec/ when you run 'rails generate rspec:install' +ENV['RAILS_ENV'] ||= 'test' +require File.expand_path('../../config/environment', __FILE__) +# Prevent database truncation if the environment is production +abort("The Rails environment is running in production mode!") if Rails.env.production? +require 'spec_helper' +require 'rspec/rails' +require 'support/factory_girl' +# Add additional requires below this line. Rails is not loaded until this point! + +# Requires supporting ruby files with custom matchers and macros, etc, in +# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are +# run as spec files by default. This means that files in spec/support that end +# in _spec.rb will both be required and run as specs, causing the specs to be +# run twice. It is recommended that you do not name files matching this glob to +# end with _spec.rb. You can configure this pattern with the --pattern +# option on the command line or in ~/.rspec, .rspec or `.rspec-local`. +# +# The following line is provided for convenience purposes. It has the downside +# of increasing the boot-up time by auto-requiring all files in the support +# directory. Alternatively, in the individual `*_spec.rb` files, manually +# require only the support files necessary. +# +# Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f } + +# Checks for pending migration and applies them before tests are run. +# If you are not using ActiveRecord, you can remove this line. +ActiveRecord::Migration.maintain_test_schema! + +RSpec.configure do |config| + config.include Devise::TestHelpers, type: :controller + config.include Warden::Test::Helpers + # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures + config.fixture_path = "#{::Rails.root}/spec/fixtures" + + # If you're not using ActiveRecord, or you'd prefer not to run each of your + # examples within a transaction, remove the following line or assign false + # instead of true. + config.use_transactional_fixtures = true + + # RSpec Rails can automatically mix in different behaviours to your tests + # based on their file location, for example enabling you to call `get` and + # `post` in specs under `spec/controllers`. + # + # You can disable this behaviour by removing the line below, and instead + # explicitly tag your specs with their type, e.g.: + # + # RSpec.describe UsersController, :type => :controller do + # # ... + # end + # + # The different available types are documented in the features, such as in + # https://relishapp.com/rspec/rspec-rails/docs + config.infer_spec_type_from_file_location! + + # Filter lines from Rails gems in backtraces. + config.filter_rails_from_backtrace! + # arbitrary gems may also be filtered via: + # config.filter_gems_from_backtrace("gem name") +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..2a60a4d --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,100 @@ +require 'devise' +# This file was generated by the `rails generate rspec:install` command. Conventionally, all +# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. +# The generated `.rspec` file contains `--require spec_helper` which will cause +# this file to always be loaded, without a need to explicitly require it in any +# files. +# +# Given that it is always loaded, you are encouraged to keep this file as +# light-weight as possible. Requiring heavyweight dependencies from this file +# will add to the boot time of your test suite on EVERY test run, even for an +# individual file that may not need all of that loaded. Instead, consider making +# a separate helper file that requires the additional dependencies and performs +# the additional setup, and require it from the spec files that actually need +# it. +# +# The `.rspec` file also contains a few flags that are not defaults but that +# users commonly want. +# +# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration +RSpec.configure do |config| + # rspec-expectations config goes here. You can use an alternate + # assertion/expectation library such as wrong or the stdlib/minitest + # assertions if you prefer. + config.expect_with :rspec do |expectations| + # This option will default to `true` in RSpec 4. It makes the `description` + # and `failure_message` of custom matchers include text for helper methods + # defined using `chain`, e.g.: + # be_bigger_than(2).and_smaller_than(4).description + # # => "be bigger than 2 and smaller than 4" + # ...rather than: + # # => "be bigger than 2" + expectations.include_chain_clauses_in_custom_matcher_descriptions = true + end + + # rspec-mocks config goes here. You can use an alternate test double + # library (such as bogus or mocha) by changing the `mock_with` option here. + config.mock_with :rspec do |mocks| + # Prevents you from mocking or stubbing a method that does not exist on + # a real object. This is generally recommended, and will default to + # `true` in RSpec 4. + mocks.verify_partial_doubles = true + end + + # This option will default to `:apply_to_host_groups` in RSpec 4 (and will + # have no way to turn it off -- the option exists only for backwards + # compatibility in RSpec 3). It causes shared context metadata to be + # inherited by the metadata hash of host groups and examples, rather than + # triggering implicit auto-inclusion in groups with matching metadata. + config.shared_context_metadata_behavior = :apply_to_host_groups + +# The settings below are suggested to provide a good initial experience +# with RSpec, but feel free to customize to your heart's content. +=begin + # This allows you to limit a spec run to individual examples or groups + # you care about by tagging them with `:focus` metadata. When nothing + # is tagged with `:focus`, all examples get run. RSpec also provides + # aliases for `it`, `describe`, and `context` that include `:focus` + # metadata: `fit`, `fdescribe` and `fcontext`, respectively. + config.filter_run_when_matching :focus + + # Allows RSpec to persist some state between runs in order to support + # the `--only-failures` and `--next-failure` CLI options. We recommend + # you configure your source control system to ignore this file. + config.example_status_persistence_file_path = "spec/examples.txt" + + # Limits the available syntax to the non-monkey patched syntax that is + # recommended. For more details, see: + # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/ + # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ + # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode + config.disable_monkey_patching! + + # Many RSpec users commonly either run the entire suite or an individual + # file, and it's useful to allow more verbose output when running an + # individual spec file. + if config.files_to_run.one? + # Use the documentation formatter for detailed output, + # unless a formatter has already been configured + # (e.g. via a command-line flag). + config.default_formatter = 'doc' + end + + # Print the 10 slowest examples and example groups at the + # end of the spec run, to help surface which specs are running + # particularly slow. + config.profile_examples = 10 + + # Run specs in random order to surface order dependencies. If you find an + # order dependency and want to debug it, you can fix the order by providing + # the seed, which is printed after each run. + # --seed 1234 + config.order = :random + + # Seed global randomization in this process using the `--seed` CLI option. + # Setting this allows you to use `--seed` to deterministically reproduce + # test failures related to randomization by passing the same `--seed` value + # as the one that triggered the failure. + Kernel.srand config.seed +=end +end diff --git a/spec/support/factory_girl.rb b/spec/support/factory_girl.rb new file mode 100644 index 0000000..db42535 --- /dev/null +++ b/spec/support/factory_girl.rb @@ -0,0 +1,13 @@ +# spec/support/factory_girl.rb +RSpec.configure do |config| + config.include FactoryGirl::Syntax::Methods +end + +# RSpec without Rails +# RSpec.configure do |config| +# config.include FactoryGirl::Syntax::Methods + +# config.before(:suite) do +# FactoryGirl.find_definitions +# end +# end \ No newline at end of file diff --git a/tmp/cache/assets/sprockets/v3.0/8e/8eZQEkJYlC6fvvppoEerVyo8z5EDl0_dSBcoFoUuGrw.cache b/tmp/cache/assets/sprockets/v3.0/8e/8eZQEkJYlC6fvvppoEerVyo8z5EDl0_dSBcoFoUuGrw.cache new file mode 100644 index 0000000..9c22d31 --- /dev/null +++ b/tmp/cache/assets/sprockets/v3.0/8e/8eZQEkJYlC6fvvppoEerVyo8z5EDl0_dSBcoFoUuGrw.cache @@ -0,0 +1 @@ +"%¦<ƒÓ•Öµ¦XÕåîÌ€#+²¬‡ÈÑ,ü(o‚Èã \ No newline at end of file diff --git a/tmp/cache/assets/sprockets/v3.0/fR/fR_qDUrtvZdSNRh6hTZ0jVc1Zwrka6tdFcebz09HXnA.cache b/tmp/cache/assets/sprockets/v3.0/fR/fR_qDUrtvZdSNRh6hTZ0jVc1Zwrka6tdFcebz09HXnA.cache new file mode 100644 index 0000000..e842955 --- /dev/null +++ b/tmp/cache/assets/sprockets/v3.0/fR/fR_qDUrtvZdSNRh6hTZ0jVc1Zwrka6tdFcebz09HXnA.cache @@ -0,0 +1 @@ +"%i­>!5ŽD>cW’ oMpì[J‡¯;Û;KïÞ \ No newline at end of file