From 2f969aaafc6bf569f9142d3bf5ff0a12c28c9f4c Mon Sep 17 00:00:00 2001 From: Kimberly-Fasbender Date: Mon, 8 Apr 2019 14:22:47 -0700 Subject: [PATCH 01/34] setup rails project --- .gitignore | 3 + .ruby-version | 1 + Gemfile | 81 ++++++ Gemfile.lock | 274 ++++++++++++++++++ Guardfile | 9 + Rakefile | 6 + app/assets/config/manifest.js | 3 + app/assets/images/.keep | 0 app/assets/javascripts/application.js | 16 + app/assets/javascripts/cable.js | 13 + app/assets/javascripts/channels/.keep | 0 app/assets/javascripts/tasks.js | 2 + app/assets/stylesheets/application.css | 15 + app/assets/stylesheets/tasks.scss | 3 + app/channels/application_cable/channel.rb | 4 + app/channels/application_cable/connection.rb | 4 + app/controllers/application_controller.rb | 2 + app/controllers/concerns/.keep | 0 app/controllers/tasks_controller.rb | 4 + app/helpers/application_helper.rb | 2 + app/helpers/tasks_helper.rb | 2 + app/jobs/application_job.rb | 2 + app/mailers/application_mailer.rb | 4 + app/models/application_record.rb | 3 + app/models/concerns/.keep | 0 app/views/layouts/application.html.erb | 15 + app/views/layouts/mailer.html.erb | 13 + app/views/layouts/mailer.text.erb | 1 + bin/bundle | 3 + bin/rails | 9 + bin/rake | 9 + bin/setup | 36 +++ bin/spring | 17 ++ bin/update | 31 ++ bin/yarn | 11 + config.ru | 5 + config/application.rb | 26 ++ config/boot.rb | 4 + config/cable.yml | 10 + config/credentials.yml.enc | 1 + config/database.yml | 85 ++++++ config/environment.rb | 5 + config/environments/development.rb | 61 ++++ config/environments/production.rb | 94 ++++++ config/environments/test.rb | 46 +++ config/initializers/action_view.rb | 1 + .../application_controller_renderer.rb | 8 + config/initializers/assets.rb | 14 + config/initializers/backtrace_silencers.rb | 7 + .../initializers/content_security_policy.rb | 25 ++ config/initializers/cookies_serializer.rb | 5 + .../initializers/filter_parameter_logging.rb | 4 + config/initializers/inflections.rb | 16 + config/initializers/mime_types.rb | 4 + config/initializers/wrap_parameters.rb | 14 + config/locales/en.yml | 33 +++ config/puma.rb | 34 +++ config/routes.rb | 3 + config/spring.rb | 6 + config/storage.yml | 34 +++ db/seeds.rb | 7 + lib/assets/.keep | 0 lib/tasks/.keep | 0 log/.keep | 0 log/development.log | 11 + package.json | 5 + public/404.html | 67 +++++ public/422.html | 67 +++++ public/500.html | 66 +++++ public/apple-touch-icon-precomposed.png | 0 public/apple-touch-icon.png | 0 public/favicon.ico | 0 public/robots.txt | 1 + storage/.keep | 0 test/application_system_test_case.rb | 5 + test/fixtures/.keep | 0 test/fixtures/files/.keep | 0 test/helpers/.keep | 0 test/integration/.keep | 0 test/mailers/.keep | 0 test/models/.keep | 0 test/system/.keep | 0 test/test_helper.rb | 26 ++ vendor/.keep | 0 84 files changed, 1398 insertions(+) create mode 100644 .ruby-version create mode 100644 Gemfile create mode 100644 Gemfile.lock create mode 100644 Guardfile create mode 100644 Rakefile create mode 100644 app/assets/config/manifest.js create mode 100644 app/assets/images/.keep create mode 100644 app/assets/javascripts/application.js create mode 100644 app/assets/javascripts/cable.js create mode 100644 app/assets/javascripts/channels/.keep create mode 100644 app/assets/javascripts/tasks.js create mode 100644 app/assets/stylesheets/application.css create mode 100644 app/assets/stylesheets/tasks.scss create mode 100644 app/channels/application_cable/channel.rb create mode 100644 app/channels/application_cable/connection.rb create mode 100644 app/controllers/application_controller.rb create mode 100644 app/controllers/concerns/.keep create mode 100644 app/controllers/tasks_controller.rb create mode 100644 app/helpers/application_helper.rb create mode 100644 app/helpers/tasks_helper.rb create mode 100644 app/jobs/application_job.rb create mode 100644 app/mailers/application_mailer.rb create mode 100644 app/models/application_record.rb create mode 100644 app/models/concerns/.keep create mode 100644 app/views/layouts/application.html.erb create mode 100644 app/views/layouts/mailer.html.erb create mode 100644 app/views/layouts/mailer.text.erb create mode 100755 bin/bundle create mode 100755 bin/rails create mode 100755 bin/rake create mode 100755 bin/setup create mode 100755 bin/spring create mode 100755 bin/update create mode 100755 bin/yarn create mode 100644 config.ru create mode 100644 config/application.rb create mode 100644 config/boot.rb create mode 100644 config/cable.yml create mode 100644 config/credentials.yml.enc create mode 100644 config/database.yml create mode 100644 config/environment.rb create mode 100644 config/environments/development.rb create mode 100644 config/environments/production.rb create mode 100644 config/environments/test.rb create mode 100644 config/initializers/action_view.rb create mode 100644 config/initializers/application_controller_renderer.rb create mode 100644 config/initializers/assets.rb create mode 100644 config/initializers/backtrace_silencers.rb create mode 100644 config/initializers/content_security_policy.rb create mode 100644 config/initializers/cookies_serializer.rb create mode 100644 config/initializers/filter_parameter_logging.rb create mode 100644 config/initializers/inflections.rb create mode 100644 config/initializers/mime_types.rb create mode 100644 config/initializers/wrap_parameters.rb create mode 100644 config/locales/en.yml create mode 100644 config/puma.rb create mode 100644 config/routes.rb create mode 100644 config/spring.rb create mode 100644 config/storage.yml create mode 100644 db/seeds.rb create mode 100644 lib/assets/.keep create mode 100644 lib/tasks/.keep create mode 100644 log/.keep create mode 100644 log/development.log create mode 100644 package.json create mode 100644 public/404.html create mode 100644 public/422.html create mode 100644 public/500.html create mode 100644 public/apple-touch-icon-precomposed.png create mode 100644 public/apple-touch-icon.png create mode 100644 public/favicon.ico create mode 100644 public/robots.txt create mode 100644 storage/.keep create mode 100644 test/application_system_test_case.rb create mode 100644 test/fixtures/.keep create mode 100644 test/fixtures/files/.keep create mode 100644 test/helpers/.keep create mode 100644 test/integration/.keep create mode 100644 test/mailers/.keep create mode 100644 test/models/.keep create mode 100644 test/system/.keep create mode 100644 test/test_helper.rb create mode 100644 vendor/.keep diff --git a/.gitignore b/.gitignore index 74b0d5d2c..40b6a3061 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,6 @@ build/ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this: .rvmrc .DS_Store + +# Ignore master key for decrypting credentials and more. +/config/master.key diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 000000000..25c81fe39 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +ruby-2.5.1 \ No newline at end of file diff --git a/Gemfile b/Gemfile new file mode 100644 index 000000000..e665f46d3 --- /dev/null +++ b/Gemfile @@ -0,0 +1,81 @@ +source 'https://rubygems.org' +git_source(:github) { |repo| "https://github.com/#{repo}.git" } + +ruby '2.5.1' + +# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' +gem 'rails', '~> 5.2.3' +# Use postgresql as the database for Active Record +gem 'pg', '>= 0.18', '< 2.0' +# Use Puma as the app server +gem 'puma', '~> 3.11' +# Use SCSS for stylesheets +gem 'sass-rails', '~> 5.0' +# Use Uglifier as compressor for JavaScript assets +gem 'uglifier', '>= 1.3.0' +# See https://github.com/rails/execjs#readme for more supported runtimes +# gem 'mini_racer', platforms: :ruby + +# Use CoffeeScript for .coffee assets and views +# gem 'coffee-rails', '~> 4.2' +# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks +gem 'turbolinks', '~> 5' +# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder +gem 'jbuilder', '~> 2.5' +# Use Redis adapter to run Action Cable in production +# gem 'redis', '~> 4.0' +# Use ActiveModel has_secure_password +# gem 'bcrypt', '~> 3.1.7' + +# Use ActiveStorage variant +# gem 'mini_magick', '~> 4.8' + +# Use Capistrano for deployment +# gem 'capistrano-rails', group: :development + +# Reduces boot times through caching; required in config/boot.rb +gem 'bootsnap', '>= 1.1.0', require: false + +group :development, :test do + # Call 'byebug' anywhere in the code to stop execution and get a debugger console + gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] +end + +group :development do + # Access an interactive console on exception pages or by calling 'console' anywhere in the code. + gem 'web-console', '>= 3.3.0' + gem 'listen', '>= 3.0.5', '< 3.2' + # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring + gem 'spring' + gem 'spring-watcher-listen', '~> 2.0.0' +end + +group :test do + # Adds support for Capybara system testing and selenium driver + gem 'capybara', '>= 2.15' + gem 'selenium-webdriver' + # Easy installation and use of chromedriver to run system tests with Chrome + gem 'chromedriver-helper' +end + +# Windows does not include zoneinfo files, so bundle the tzinfo-data gem +gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] + +gem 'jquery-turbolinks' +gem 'jquery-rails' +group :development, :test do + gem 'pry-rails' +end + +group :development do + gem 'better_errors' + gem 'binding_of_caller' + gem 'guard' + gem 'guard-minitest' +end + +group :test do + gem 'minitest-rails' + gem 'minitest-reporters' + gem 'minitest-skip' +end diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 000000000..e5a2992a5 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,274 @@ +GEM + remote: https://rubygems.org/ + specs: + actioncable (5.2.3) + actionpack (= 5.2.3) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailer (5.2.3) + actionpack (= 5.2.3) + actionview (= 5.2.3) + activejob (= 5.2.3) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 2.0) + actionpack (5.2.3) + actionview (= 5.2.3) + activesupport (= 5.2.3) + rack (~> 2.0) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionview (5.2.3) + activesupport (= 5.2.3) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.3) + activejob (5.2.3) + activesupport (= 5.2.3) + globalid (>= 0.3.6) + activemodel (5.2.3) + activesupport (= 5.2.3) + activerecord (5.2.3) + activemodel (= 5.2.3) + activesupport (= 5.2.3) + arel (>= 9.0) + activestorage (5.2.3) + actionpack (= 5.2.3) + activerecord (= 5.2.3) + marcel (~> 0.3.1) + activesupport (5.2.3) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) + addressable (2.6.0) + public_suffix (>= 2.0.2, < 4.0) + ansi (1.5.0) + archive-zip (0.12.0) + io-like (~> 0.3.0) + arel (9.0.0) + better_errors (2.5.1) + coderay (>= 1.0.0) + erubi (>= 1.0.0) + rack (>= 0.9.0) + bindex (0.7.0) + binding_of_caller (0.8.0) + debug_inspector (>= 0.0.1) + bootsnap (1.4.3) + msgpack (~> 1.0) + builder (3.2.3) + byebug (11.0.1) + capybara (3.16.1) + addressable + mini_mime (>= 0.1.3) + nokogiri (~> 1.8) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + regexp_parser (~> 1.2) + xpath (~> 3.2) + childprocess (0.9.0) + ffi (~> 1.0, >= 1.0.11) + chromedriver-helper (2.1.1) + archive-zip (~> 0.10) + nokogiri (~> 1.8) + coderay (1.1.2) + concurrent-ruby (1.1.5) + crass (1.0.4) + debug_inspector (0.0.3) + erubi (1.8.0) + execjs (2.7.0) + ffi (1.10.0) + formatador (0.2.5) + globalid (0.4.2) + activesupport (>= 4.2.0) + guard (2.15.0) + formatador (>= 0.2.4) + listen (>= 2.7, < 4.0) + lumberjack (>= 1.0.12, < 2.0) + nenv (~> 0.1) + notiffany (~> 0.0) + pry (>= 0.9.12) + shellany (~> 0.0) + thor (>= 0.18.1) + guard-compat (1.2.1) + guard-minitest (2.4.6) + guard-compat (~> 1.2) + minitest (>= 3.0) + i18n (1.6.0) + concurrent-ruby (~> 1.0) + io-like (0.3.0) + jbuilder (2.8.0) + activesupport (>= 4.2.0) + multi_json (>= 1.2) + jquery-rails (4.3.3) + rails-dom-testing (>= 1, < 3) + railties (>= 4.2.0) + thor (>= 0.14, < 2.0) + jquery-turbolinks (2.1.0) + railties (>= 3.1.0) + turbolinks + listen (3.1.5) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + ruby_dep (~> 1.2) + loofah (2.2.3) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) + lumberjack (1.0.13) + mail (2.7.1) + mini_mime (>= 0.1.1) + marcel (0.3.3) + mimemagic (~> 0.3.2) + method_source (0.9.2) + mimemagic (0.3.3) + mini_mime (1.0.1) + mini_portile2 (2.4.0) + minitest (5.11.3) + minitest-rails (3.0.0) + minitest (~> 5.8) + railties (~> 5.0) + minitest-reporters (1.3.6) + ansi + builder + minitest (>= 5.0) + ruby-progressbar + minitest-skip (0.0.1) + minitest (~> 5.0) + msgpack (1.2.9) + multi_json (1.13.1) + nenv (0.3.0) + nio4r (2.3.1) + nokogiri (1.10.2) + mini_portile2 (~> 2.4.0) + notiffany (0.1.1) + nenv (~> 0.1) + shellany (~> 0.0) + pg (1.1.4) + pry (0.12.2) + coderay (~> 1.1.0) + method_source (~> 0.9.0) + pry-rails (0.3.9) + pry (>= 0.10.4) + public_suffix (3.0.3) + puma (3.12.1) + rack (2.0.7) + rack-test (1.1.0) + rack (>= 1.0, < 3) + rails (5.2.3) + actioncable (= 5.2.3) + actionmailer (= 5.2.3) + actionpack (= 5.2.3) + actionview (= 5.2.3) + activejob (= 5.2.3) + activemodel (= 5.2.3) + activerecord (= 5.2.3) + activestorage (= 5.2.3) + activesupport (= 5.2.3) + bundler (>= 1.3.0) + railties (= 5.2.3) + sprockets-rails (>= 2.0.0) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.0.4) + loofah (~> 2.2, >= 2.2.2) + railties (5.2.3) + actionpack (= 5.2.3) + activesupport (= 5.2.3) + method_source + rake (>= 0.8.7) + thor (>= 0.19.0, < 2.0) + rake (12.3.2) + rb-fsevent (0.10.3) + rb-inotify (0.10.0) + ffi (~> 1.0) + regexp_parser (1.4.0) + ruby-progressbar (1.10.0) + ruby_dep (1.5.0) + rubyzip (1.2.2) + sass (3.7.4) + sass-listen (~> 4.0.0) + sass-listen (4.0.0) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + sass-rails (5.0.7) + railties (>= 4.0.0, < 6) + sass (~> 3.1) + sprockets (>= 2.8, < 4.0) + sprockets-rails (>= 2.0, < 4.0) + tilt (>= 1.1, < 3) + selenium-webdriver (3.141.0) + childprocess (~> 0.5) + rubyzip (~> 1.2, >= 1.2.2) + shellany (0.0.1) + spring (2.0.2) + activesupport (>= 4.2) + spring-watcher-listen (2.0.1) + listen (>= 2.7, < 4.0) + spring (>= 1.2, < 3.0) + sprockets (3.7.2) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.2.1) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + thor (0.20.3) + thread_safe (0.3.6) + tilt (2.0.9) + turbolinks (5.2.0) + turbolinks-source (~> 5.2) + turbolinks-source (5.2.0) + tzinfo (1.2.5) + thread_safe (~> 0.1) + uglifier (4.1.20) + execjs (>= 0.3.0, < 3) + web-console (3.7.0) + actionview (>= 5.0) + activemodel (>= 5.0) + bindex (>= 0.4.0) + railties (>= 5.0) + websocket-driver (0.7.0) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.3) + xpath (3.2.0) + nokogiri (~> 1.8) + +PLATFORMS + ruby + +DEPENDENCIES + better_errors + binding_of_caller + bootsnap (>= 1.1.0) + byebug + capybara (>= 2.15) + chromedriver-helper + guard + guard-minitest + jbuilder (~> 2.5) + jquery-rails + jquery-turbolinks + listen (>= 3.0.5, < 3.2) + minitest-rails + minitest-reporters + minitest-skip + pg (>= 0.18, < 2.0) + pry-rails + puma (~> 3.11) + rails (~> 5.2.3) + sass-rails (~> 5.0) + selenium-webdriver + spring + spring-watcher-listen (~> 2.0.0) + turbolinks (~> 5) + tzinfo-data + uglifier (>= 1.3.0) + web-console (>= 3.3.0) + +RUBY VERSION + ruby 2.5.1p57 + +BUNDLED WITH + 1.17.3 diff --git a/Guardfile b/Guardfile new file mode 100644 index 000000000..e34f706f4 --- /dev/null +++ b/Guardfile @@ -0,0 +1,9 @@ +guard :minitest, autorun: false, spring: true do + watch(%r{^app/(.+).rb$}) { |m| "test/#{m[1]}_test.rb" } + watch(%r{^app/controllers/application_controller.rb$}) { 'test/controllers' } + watch(%r{^app/controllers/(.+)_controller.rb$}) { |m| "test/integration/#{m[1]}_test.rb" } + watch(%r{^app/views/(.+)_mailer/.+}) { |m| "test/mailers/#{m[1]}_mailer_test.rb" } + watch(%r{^lib/(.+).rb$}) { |m| "test/lib/#{m[1]}_test.rb" } + watch(%r{^test/.+_test.rb$}) + watch(%r{^test/test_helper.rb$}) { 'test' } +end diff --git a/Rakefile b/Rakefile new file mode 100644 index 000000000..e85f91391 --- /dev/null +++ b/Rakefile @@ -0,0 +1,6 @@ +# Add your own tasks in files placed in lib/tasks ending in .rake, +# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. + +require_relative 'config/application' + +Rails.application.load_tasks diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js new file mode 100644 index 000000000..b16e53d6d --- /dev/null +++ b/app/assets/config/manifest.js @@ -0,0 +1,3 @@ +//= link_tree ../images +//= link_directory ../javascripts .js +//= link_directory ../stylesheets .css diff --git a/app/assets/images/.keep b/app/assets/images/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js new file mode 100644 index 000000000..82e6f0f6c --- /dev/null +++ b/app/assets/javascripts/application.js @@ -0,0 +1,16 @@ +// This is a manifest file that'll be compiled into application.js, which will include all the files +// listed below. +// +// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, or any plugin's +// vendor/assets/javascripts directory can be referenced here using a relative path. +// +// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the +// compiled file. JavaScript code in this file should be added after the last require_* statement. +// +// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details +// about supported directives. +// +//= require rails-ujs +//= require activestorage +//= require turbolinks +//= require_tree . diff --git a/app/assets/javascripts/cable.js b/app/assets/javascripts/cable.js new file mode 100644 index 000000000..739aa5f02 --- /dev/null +++ b/app/assets/javascripts/cable.js @@ -0,0 +1,13 @@ +// Action Cable provides the framework to deal with WebSockets in Rails. +// You can generate new channels where WebSocket features live using the `rails generate channel` command. +// +//= require action_cable +//= require_self +//= require_tree ./channels + +(function() { + this.App || (this.App = {}); + + App.cable = ActionCable.createConsumer(); + +}).call(this); diff --git a/app/assets/javascripts/channels/.keep b/app/assets/javascripts/channels/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/app/assets/javascripts/tasks.js b/app/assets/javascripts/tasks.js new file mode 100644 index 000000000..dee720fac --- /dev/null +++ b/app/assets/javascripts/tasks.js @@ -0,0 +1,2 @@ +// Place all the behaviors and hooks related to the matching controller here. +// All this logic will automatically be available in application.js. diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css new file mode 100644 index 000000000..d05ea0f51 --- /dev/null +++ b/app/assets/stylesheets/application.css @@ -0,0 +1,15 @@ +/* + * This is a manifest file that'll be compiled into application.css, which will include all the files + * listed below. + * + * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's + * vendor/assets/stylesheets directory can be referenced here using a relative path. + * + * You're free to add application-wide styles to this file and they'll appear at the bottom of the + * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS + * files in this directory. Styles in this file should be added after the last require_* statement. + * It is generally better to create a new file per style scope. + * + *= require_tree . + *= require_self + */ diff --git a/app/assets/stylesheets/tasks.scss b/app/assets/stylesheets/tasks.scss new file mode 100644 index 000000000..c5e7712d4 --- /dev/null +++ b/app/assets/stylesheets/tasks.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the Tasks controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/channels/application_cable/channel.rb b/app/channels/application_cable/channel.rb new file mode 100644 index 000000000..d67269728 --- /dev/null +++ b/app/channels/application_cable/channel.rb @@ -0,0 +1,4 @@ +module ApplicationCable + class Channel < ActionCable::Channel::Base + end +end diff --git a/app/channels/application_cable/connection.rb b/app/channels/application_cable/connection.rb new file mode 100644 index 000000000..0ff5442f4 --- /dev/null +++ b/app/channels/application_cable/connection.rb @@ -0,0 +1,4 @@ +module ApplicationCable + class Connection < ActionCable::Connection::Base + end +end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb new file mode 100644 index 000000000..09705d12a --- /dev/null +++ b/app/controllers/application_controller.rb @@ -0,0 +1,2 @@ +class ApplicationController < ActionController::Base +end diff --git a/app/controllers/concerns/.keep b/app/controllers/concerns/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/app/controllers/tasks_controller.rb b/app/controllers/tasks_controller.rb new file mode 100644 index 000000000..d180841e6 --- /dev/null +++ b/app/controllers/tasks_controller.rb @@ -0,0 +1,4 @@ +class TasksController < ApplicationController + def index + end +end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb new file mode 100644 index 000000000..de6be7945 --- /dev/null +++ b/app/helpers/application_helper.rb @@ -0,0 +1,2 @@ +module ApplicationHelper +end diff --git a/app/helpers/tasks_helper.rb b/app/helpers/tasks_helper.rb new file mode 100644 index 000000000..ce894d00c --- /dev/null +++ b/app/helpers/tasks_helper.rb @@ -0,0 +1,2 @@ +module TasksHelper +end diff --git a/app/jobs/application_job.rb b/app/jobs/application_job.rb new file mode 100644 index 000000000..a009ace51 --- /dev/null +++ b/app/jobs/application_job.rb @@ -0,0 +1,2 @@ +class ApplicationJob < ActiveJob::Base +end diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb new file mode 100644 index 000000000..286b2239d --- /dev/null +++ b/app/mailers/application_mailer.rb @@ -0,0 +1,4 @@ +class ApplicationMailer < ActionMailer::Base + default from: 'from@example.com' + layout 'mailer' +end diff --git a/app/models/application_record.rb b/app/models/application_record.rb new file mode 100644 index 000000000..10a4cba84 --- /dev/null +++ b/app/models/application_record.rb @@ -0,0 +1,3 @@ +class ApplicationRecord < ActiveRecord::Base + self.abstract_class = true +end diff --git a/app/models/concerns/.keep b/app/models/concerns/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb new file mode 100644 index 000000000..b9ce64348 --- /dev/null +++ b/app/views/layouts/application.html.erb @@ -0,0 +1,15 @@ + + + + TaskList + <%= csrf_meta_tags %> + <%= csp_meta_tag %> + + <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> + <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %> + + + + <%= yield %> + + diff --git a/app/views/layouts/mailer.html.erb b/app/views/layouts/mailer.html.erb new file mode 100644 index 000000000..cbd34d2e9 --- /dev/null +++ b/app/views/layouts/mailer.html.erb @@ -0,0 +1,13 @@ + + + + + + + + + <%= yield %> + + diff --git a/app/views/layouts/mailer.text.erb b/app/views/layouts/mailer.text.erb new file mode 100644 index 000000000..37f0bddbd --- /dev/null +++ b/app/views/layouts/mailer.text.erb @@ -0,0 +1 @@ +<%= yield %> diff --git a/bin/bundle b/bin/bundle new file mode 100755 index 000000000..f19acf5b5 --- /dev/null +++ b/bin/bundle @@ -0,0 +1,3 @@ +#!/usr/bin/env ruby +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) +load Gem.bin_path('bundler', 'bundle') diff --git a/bin/rails b/bin/rails new file mode 100755 index 000000000..5badb2fde --- /dev/null +++ b/bin/rails @@ -0,0 +1,9 @@ +#!/usr/bin/env ruby +begin + load File.expand_path('../spring', __FILE__) +rescue LoadError => e + raise unless e.message.include?('spring') +end +APP_PATH = File.expand_path('../config/application', __dir__) +require_relative '../config/boot' +require 'rails/commands' diff --git a/bin/rake b/bin/rake new file mode 100755 index 000000000..d87d5f578 --- /dev/null +++ b/bin/rake @@ -0,0 +1,9 @@ +#!/usr/bin/env ruby +begin + load File.expand_path('../spring', __FILE__) +rescue LoadError => e + raise unless e.message.include?('spring') +end +require_relative '../config/boot' +require 'rake' +Rake.application.run diff --git a/bin/setup b/bin/setup new file mode 100755 index 000000000..94fd4d797 --- /dev/null +++ b/bin/setup @@ -0,0 +1,36 @@ +#!/usr/bin/env ruby +require 'fileutils' +include FileUtils + +# path to your application root. +APP_ROOT = File.expand_path('..', __dir__) + +def system!(*args) + system(*args) || abort("\n== Command #{args} failed ==") +end + +chdir APP_ROOT do + # This script is a starting point to setup your application. + # Add necessary setup steps to this file. + + puts '== Installing dependencies ==' + system! 'gem install bundler --conservative' + system('bundle check') || system!('bundle install') + + # Install JavaScript dependencies if using Yarn + # system('bin/yarn') + + # puts "\n== Copying sample files ==" + # unless File.exist?('config/database.yml') + # cp 'config/database.yml.sample', 'config/database.yml' + # end + + puts "\n== Preparing database ==" + system! 'bin/rails db:setup' + + puts "\n== Removing old logs and tempfiles ==" + system! 'bin/rails log:clear tmp:clear' + + puts "\n== Restarting application server ==" + system! 'bin/rails restart' +end diff --git a/bin/spring b/bin/spring new file mode 100755 index 000000000..fb2ec2ebb --- /dev/null +++ b/bin/spring @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby + +# This file loads spring without using Bundler, in order to be fast. +# It gets overwritten when you run the `spring binstub` command. + +unless defined?(Spring) + require 'rubygems' + require 'bundler' + + lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read) + spring = lockfile.specs.detect { |spec| spec.name == "spring" } + if spring + Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path + gem 'spring', spring.version + require 'spring/binstub' + end +end diff --git a/bin/update b/bin/update new file mode 100755 index 000000000..58bfaed51 --- /dev/null +++ b/bin/update @@ -0,0 +1,31 @@ +#!/usr/bin/env ruby +require 'fileutils' +include FileUtils + +# path to your application root. +APP_ROOT = File.expand_path('..', __dir__) + +def system!(*args) + system(*args) || abort("\n== Command #{args} failed ==") +end + +chdir APP_ROOT do + # This script is a way to update your development environment automatically. + # Add necessary update steps to this file. + + puts '== Installing dependencies ==' + system! 'gem install bundler --conservative' + system('bundle check') || system!('bundle install') + + # Install JavaScript dependencies if using Yarn + # system('bin/yarn') + + puts "\n== Updating database ==" + system! 'bin/rails db:migrate' + + puts "\n== Removing old logs and tempfiles ==" + system! 'bin/rails log:clear tmp:clear' + + puts "\n== Restarting application server ==" + system! 'bin/rails restart' +end diff --git a/bin/yarn b/bin/yarn new file mode 100755 index 000000000..460dd565b --- /dev/null +++ b/bin/yarn @@ -0,0 +1,11 @@ +#!/usr/bin/env ruby +APP_ROOT = File.expand_path('..', __dir__) +Dir.chdir(APP_ROOT) do + begin + exec "yarnpkg", *ARGV + rescue Errno::ENOENT + $stderr.puts "Yarn executable was not detected in the system." + $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install" + exit 1 + end +end diff --git a/config.ru b/config.ru new file mode 100644 index 000000000..f7ba0b527 --- /dev/null +++ b/config.ru @@ -0,0 +1,5 @@ +# This file is used by Rack-based servers to start the application. + +require_relative 'config/environment' + +run Rails.application diff --git a/config/application.rb b/config/application.rb new file mode 100644 index 000000000..77b3ec01b --- /dev/null +++ b/config/application.rb @@ -0,0 +1,26 @@ +require_relative 'boot' + +require 'rails/all' + +# Require the gems listed in Gemfile, including any gems +# you've limited to :test, :development, or :production. +Bundler.require(*Rails.groups) + +module TaskList + class Application < Rails::Application + config.generators do |g| + # Force new test files to be generated in the minitest-spec style + g.test_framework :minitest, spec: true + + # Always use .js files, never .coffee + g.javascript_engine :js + end + # Initialize configuration defaults for originally generated Rails version. + config.load_defaults 5.2 + + # Settings in config/environments/* take precedence over those specified here. + # Application configuration can go into files in config/initializers + # -- all .rb files in that directory are automatically loaded after loading + # the framework and any gems in your application. + end +end diff --git a/config/boot.rb b/config/boot.rb new file mode 100644 index 000000000..b9e460cef --- /dev/null +++ b/config/boot.rb @@ -0,0 +1,4 @@ +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) + +require 'bundler/setup' # Set up gems listed in the Gemfile. +require 'bootsnap/setup' # Speed up boot time by caching expensive operations. diff --git a/config/cable.yml b/config/cable.yml new file mode 100644 index 000000000..51266cdbe --- /dev/null +++ b/config/cable.yml @@ -0,0 +1,10 @@ +development: + adapter: async + +test: + adapter: async + +production: + adapter: redis + url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> + channel_prefix: TaskList_production diff --git a/config/credentials.yml.enc b/config/credentials.yml.enc new file mode 100644 index 000000000..d48ccfc37 --- /dev/null +++ b/config/credentials.yml.enc @@ -0,0 +1 @@ +GL/kMwrj5fOXusonB9BaOPXuDB1ksk0mSwD1rNYjz3TM8KlxyrknNlOFTx4LLVVPkmkelxGTaXgYqKKKgYEKMffTg0nWs9wLv2D4pKoPcR/kTCz+Ko+JKUeULTHc8HZ32Ro5w/ZNJL6w90iA/otaRhW7gm3TB4IOXkeY0vKOGdFvDnJ8F6Lo70mAymASixbDpJBQxped6sZBKbEjV0mDbscUsAKL11yjzpYer1TuuAWoYHAg1NBxO6/HzCa99Gz9tu6THERAH5iUrm0dV7Ud2kR0Xo4Yjo6m3WjAZ+lh4PjrhpzAnTypF/ffJvrDrjxwnKMevlPy4DAG0zORRDgs2DyrYhsSMSIzYSHRc1flh/imPDjPSe3taRftHFDTcFWalwkDtVURY9QybpaXPiGre1CKuixtlkAk93dR--ekd+azuOjR4AXwAc--YP07oYHC/KzAdLxDrJrlOQ== \ No newline at end of file diff --git a/config/database.yml b/config/database.yml new file mode 100644 index 000000000..40243c8b5 --- /dev/null +++ b/config/database.yml @@ -0,0 +1,85 @@ +# PostgreSQL. Versions 9.1 and up are supported. +# +# Install the pg driver: +# gem install pg +# On OS X with Homebrew: +# gem install pg -- --with-pg-config=/usr/local/bin/pg_config +# On OS X with MacPorts: +# gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config +# On Windows: +# gem install pg +# Choose the win32 build. +# Install PostgreSQL and put its /bin directory on your path. +# +# Configure Using Gemfile +# gem 'pg' +# +default: &default + adapter: postgresql + encoding: unicode + # For details on connection pooling, see Rails configuration guide + # http://guides.rubyonrails.org/configuring.html#database-pooling + pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> + +development: + <<: *default + database: TaskList_development + + # The specified database role being used to connect to postgres. + # To create additional roles in postgres see `$ createuser --help`. + # When left blank, postgres will use the default role. This is + # the same name as the operating system user that initialized the database. + #username: TaskList + + # The password associated with the postgres role (username). + #password: + + # Connect on a TCP socket. Omitted by default since the client uses a + # domain socket that doesn't need configuration. Windows does not have + # domain sockets, so uncomment these lines. + #host: localhost + + # The TCP port the server listens on. Defaults to 5432. + # If your server runs on a different port number, change accordingly. + #port: 5432 + + # Schema search path. The server defaults to $user,public + #schema_search_path: myapp,sharedapp,public + + # Minimum log levels, in increasing order: + # debug5, debug4, debug3, debug2, debug1, + # log, notice, warning, error, fatal, and panic + # Defaults to warning. + #min_messages: notice + +# Warning: The database defined as "test" will be erased and +# re-generated from your development database when you run "rake". +# Do not set this db to the same as development or production. +test: + <<: *default + database: TaskList_test + +# As with config/secrets.yml, you never want to store sensitive information, +# like your database password, in your source code. If your source code is +# ever seen by anyone, they now have access to your database. +# +# Instead, provide the password as a unix environment variable when you boot +# the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database +# for a full rundown on how to provide these environment variables in a +# production deployment. +# +# On Heroku and other platform providers, you may have a full connection URL +# available as an environment variable. For example: +# +# DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase" +# +# You can use this database configuration with: +# +# production: +# url: <%= ENV['DATABASE_URL'] %> +# +production: + <<: *default + database: TaskList_production + username: TaskList + password: <%= ENV['TASKLIST_DATABASE_PASSWORD'] %> diff --git a/config/environment.rb b/config/environment.rb new file mode 100644 index 000000000..426333bb4 --- /dev/null +++ b/config/environment.rb @@ -0,0 +1,5 @@ +# Load the Rails application. +require_relative 'application' + +# Initialize the Rails application. +Rails.application.initialize! diff --git a/config/environments/development.rb b/config/environments/development.rb new file mode 100644 index 000000000..1311e3e4e --- /dev/null +++ b/config/environments/development.rb @@ -0,0 +1,61 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # In the development environment your application's code is reloaded on + # every request. This slows down response time but is perfect for development + # since you don't have to restart the web server when you make code changes. + config.cache_classes = false + + # Do not eager load code on boot. + config.eager_load = false + + # Show full error reports. + config.consider_all_requests_local = true + + # Enable/disable caching. By default caching is disabled. + # Run rails dev:cache to toggle caching. + if Rails.root.join('tmp', 'caching-dev.txt').exist? + config.action_controller.perform_caching = true + + config.cache_store = :memory_store + config.public_file_server.headers = { + 'Cache-Control' => "public, max-age=#{2.days.to_i}" + } + else + config.action_controller.perform_caching = false + + config.cache_store = :null_store + end + + # Store uploaded files on the local file system (see config/storage.yml for options) + config.active_storage.service = :local + + # Don't care if the mailer can't send. + config.action_mailer.raise_delivery_errors = false + + config.action_mailer.perform_caching = false + + # Print deprecation notices to the Rails logger. + config.active_support.deprecation = :log + + # Raise an error on page load if there are pending migrations. + config.active_record.migration_error = :page_load + + # Highlight code that triggered database queries in logs. + config.active_record.verbose_query_logs = true + + # Debug mode disables concatenation and preprocessing of assets. + # This option may cause significant delays in view rendering with a large + # number of complex assets. + config.assets.debug = true + + # Suppress logger output for asset requests. + config.assets.quiet = true + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true + + # Use an evented file watcher to asynchronously detect changes in source code, + # routes, locales, etc. This feature depends on the listen gem. + config.file_watcher = ActiveSupport::EventedFileUpdateChecker +end diff --git a/config/environments/production.rb b/config/environments/production.rb new file mode 100644 index 000000000..4cef70af5 --- /dev/null +++ b/config/environments/production.rb @@ -0,0 +1,94 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # Code is not reloaded between requests. + config.cache_classes = true + + # Eager load code on boot. This eager loads most of Rails and + # your application in memory, allowing both threaded web servers + # and those relying on copy on write to perform better. + # Rake tasks automatically ignore this option for performance. + config.eager_load = true + + # Full error reports are disabled and caching is turned on. + config.consider_all_requests_local = false + config.action_controller.perform_caching = true + + # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"] + # or in config/master.key. This key is used to decrypt credentials (and other encrypted files). + # config.require_master_key = true + + # Disable serving static files from the `/public` folder by default since + # Apache or NGINX already handles this. + config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? + + # Compress JavaScripts and CSS. + config.assets.js_compressor = :uglifier + # config.assets.css_compressor = :sass + + # Do not fallback to assets pipeline if a precompiled asset is missed. + config.assets.compile = false + + # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb + + # Enable serving of images, stylesheets, and JavaScripts from an asset server. + # config.action_controller.asset_host = 'http://assets.example.com' + + # Specifies the header that your server uses for sending files. + # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache + # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX + + # Store uploaded files on the local file system (see config/storage.yml for options) + config.active_storage.service = :local + + # Mount Action Cable outside main process or domain + # config.action_cable.mount_path = nil + # config.action_cable.url = 'wss://example.com/cable' + # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + # config.force_ssl = true + + # Use the lowest log level to ensure availability of diagnostic information + # when problems arise. + config.log_level = :debug + + # Prepend all log lines with the following tags. + config.log_tags = [ :request_id ] + + # Use a different cache store in production. + # config.cache_store = :mem_cache_store + + # Use a real queuing backend for Active Job (and separate queues per environment) + # config.active_job.queue_adapter = :resque + # config.active_job.queue_name_prefix = "TaskList_#{Rails.env}" + + config.action_mailer.perform_caching = false + + # Ignore bad email addresses and do not raise email delivery errors. + # Set this to true and configure the email server for immediate delivery to raise delivery errors. + # config.action_mailer.raise_delivery_errors = false + + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to + # the I18n.default_locale when a translation cannot be found). + config.i18n.fallbacks = true + + # Send deprecation notices to registered listeners. + config.active_support.deprecation = :notify + + # Use default logging formatter so that PID and timestamp are not suppressed. + config.log_formatter = ::Logger::Formatter.new + + # Use a different logger for distributed setups. + # require 'syslog/logger' + # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') + + if ENV["RAILS_LOG_TO_STDOUT"].present? + logger = ActiveSupport::Logger.new(STDOUT) + logger.formatter = config.log_formatter + config.logger = ActiveSupport::TaggedLogging.new(logger) + end + + # Do not dump schema after migrations. + config.active_record.dump_schema_after_migration = false +end diff --git a/config/environments/test.rb b/config/environments/test.rb new file mode 100644 index 000000000..0a38fd3ce --- /dev/null +++ b/config/environments/test.rb @@ -0,0 +1,46 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # The test environment is used exclusively to run your application's + # test suite. You never need to work with it otherwise. Remember that + # your test database is "scratch space" for the test suite and is wiped + # and recreated between test runs. Don't rely on the data there! + config.cache_classes = true + + # Do not eager load code on boot. This avoids loading your whole application + # just for the purpose of running a single test. If you are using a tool that + # preloads Rails for running tests, you may have to set it to true. + config.eager_load = false + + # Configure public file server for tests with Cache-Control for performance. + config.public_file_server.enabled = true + config.public_file_server.headers = { + 'Cache-Control' => "public, max-age=#{1.hour.to_i}" + } + + # Show full error reports and disable caching. + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Raise exceptions instead of rendering exception templates. + config.action_dispatch.show_exceptions = false + + # Disable request forgery protection in test environment. + config.action_controller.allow_forgery_protection = false + + # Store uploaded files on the local file system in a temporary directory + config.active_storage.service = :test + + config.action_mailer.perform_caching = false + + # Tell Action Mailer not to deliver emails to the real world. + # The :test delivery method accumulates sent emails in the + # ActionMailer::Base.deliveries array. + config.action_mailer.delivery_method = :test + + # Print deprecation notices to the stderr. + config.active_support.deprecation = :stderr + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true +end diff --git a/config/initializers/action_view.rb b/config/initializers/action_view.rb new file mode 100644 index 000000000..142d382f8 --- /dev/null +++ b/config/initializers/action_view.rb @@ -0,0 +1 @@ +Rails.application.config.action_view.form_with_generates_remote_forms = false diff --git a/config/initializers/application_controller_renderer.rb b/config/initializers/application_controller_renderer.rb new file mode 100644 index 000000000..89d2efab2 --- /dev/null +++ b/config/initializers/application_controller_renderer.rb @@ -0,0 +1,8 @@ +# Be sure to restart your server when you modify this file. + +# ActiveSupport::Reloader.to_prepare do +# ApplicationController.renderer.defaults.merge!( +# http_host: 'example.org', +# https: false +# ) +# end diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb new file mode 100644 index 000000000..4b828e80c --- /dev/null +++ b/config/initializers/assets.rb @@ -0,0 +1,14 @@ +# Be sure to restart your server when you modify this file. + +# Version of your assets, change this if you want to expire all your assets. +Rails.application.config.assets.version = '1.0' + +# Add additional assets to the asset load path. +# Rails.application.config.assets.paths << Emoji.images_path +# Add Yarn node_modules folder to the asset load path. +Rails.application.config.assets.paths << Rails.root.join('node_modules') + +# Precompile additional assets. +# application.js, application.css, and all non-JS/CSS in the app/assets +# folder are already added. +# Rails.application.config.assets.precompile += %w( admin.js admin.css ) diff --git a/config/initializers/backtrace_silencers.rb b/config/initializers/backtrace_silencers.rb new file mode 100644 index 000000000..59385cdf3 --- /dev/null +++ b/config/initializers/backtrace_silencers.rb @@ -0,0 +1,7 @@ +# Be sure to restart your server when you modify this file. + +# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. +# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } + +# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. +# Rails.backtrace_cleaner.remove_silencers! diff --git a/config/initializers/content_security_policy.rb b/config/initializers/content_security_policy.rb new file mode 100644 index 000000000..d3bcaa5ec --- /dev/null +++ b/config/initializers/content_security_policy.rb @@ -0,0 +1,25 @@ +# Be sure to restart your server when you modify this file. + +# Define an application-wide content security policy +# For further information see the following documentation +# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy + +# Rails.application.config.content_security_policy do |policy| +# policy.default_src :self, :https +# policy.font_src :self, :https, :data +# policy.img_src :self, :https, :data +# policy.object_src :none +# policy.script_src :self, :https +# policy.style_src :self, :https + +# # Specify URI for violation reports +# # policy.report_uri "/csp-violation-report-endpoint" +# end + +# If you are using UJS then enable automatic nonce generation +# Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) } + +# Report CSP violations to a specified URI +# For further information see the following documentation: +# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only +# Rails.application.config.content_security_policy_report_only = true diff --git a/config/initializers/cookies_serializer.rb b/config/initializers/cookies_serializer.rb new file mode 100644 index 000000000..5a6a32d37 --- /dev/null +++ b/config/initializers/cookies_serializer.rb @@ -0,0 +1,5 @@ +# Be sure to restart your server when you modify this file. + +# Specify a serializer for the signed and encrypted cookie jars. +# Valid options are :json, :marshal, and :hybrid. +Rails.application.config.action_dispatch.cookies_serializer = :json diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb new file mode 100644 index 000000000..4a994e1e7 --- /dev/null +++ b/config/initializers/filter_parameter_logging.rb @@ -0,0 +1,4 @@ +# Be sure to restart your server when you modify this file. + +# Configure sensitive parameters which will be filtered from the log file. +Rails.application.config.filter_parameters += [:password] diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb new file mode 100644 index 000000000..ac033bf9d --- /dev/null +++ b/config/initializers/inflections.rb @@ -0,0 +1,16 @@ +# Be sure to restart your server when you modify this file. + +# Add new inflection rules using the following format. Inflections +# are locale specific, and you may define rules for as many different +# locales as you wish. All of these examples are active by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.plural /^(ox)$/i, '\1en' +# inflect.singular /^(ox)en/i, '\1' +# inflect.irregular 'person', 'people' +# inflect.uncountable %w( fish sheep ) +# end + +# These inflection rules are supported but not enabled by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.acronym 'RESTful' +# end diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb new file mode 100644 index 000000000..dc1899682 --- /dev/null +++ b/config/initializers/mime_types.rb @@ -0,0 +1,4 @@ +# Be sure to restart your server when you modify this file. + +# Add new mime types for use in respond_to blocks: +# Mime::Type.register "text/richtext", :rtf diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb new file mode 100644 index 000000000..bbfc3961b --- /dev/null +++ b/config/initializers/wrap_parameters.rb @@ -0,0 +1,14 @@ +# Be sure to restart your server when you modify this file. + +# This file contains settings for ActionController::ParamsWrapper which +# is enabled by default. + +# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. +ActiveSupport.on_load(:action_controller) do + wrap_parameters format: [:json] +end + +# To enable root element in JSON for ActiveRecord objects. +# ActiveSupport.on_load(:active_record) do +# self.include_root_in_json = true +# end diff --git a/config/locales/en.yml b/config/locales/en.yml new file mode 100644 index 000000000..decc5a857 --- /dev/null +++ b/config/locales/en.yml @@ -0,0 +1,33 @@ +# Files in the config/locales directory are used for internationalization +# and are automatically loaded by Rails. If you want to use locales other +# than English, add the necessary files in this directory. +# +# To use the locales, use `I18n.t`: +# +# I18n.t 'hello' +# +# In views, this is aliased to just `t`: +# +# <%= t('hello') %> +# +# To use a different locale, set it with `I18n.locale`: +# +# I18n.locale = :es +# +# This would use the information in config/locales/es.yml. +# +# The following keys must be escaped otherwise they will not be retrieved by +# the default I18n backend: +# +# true, false, on, off, yes, no +# +# Instead, surround them with single quotes. +# +# en: +# 'true': 'foo' +# +# To learn more, please read the Rails Internationalization guide +# available at http://guides.rubyonrails.org/i18n.html. + +en: + hello: "Hello world" diff --git a/config/puma.rb b/config/puma.rb new file mode 100644 index 000000000..a5eccf816 --- /dev/null +++ b/config/puma.rb @@ -0,0 +1,34 @@ +# Puma can serve each request in a thread from an internal thread pool. +# The `threads` method setting takes two numbers: a minimum and maximum. +# Any libraries that use thread pools should be configured to match +# the maximum value specified for Puma. Default is set to 5 threads for minimum +# and maximum; this matches the default thread size of Active Record. +# +threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } +threads threads_count, threads_count + +# Specifies the `port` that Puma will listen on to receive requests; default is 3000. +# +port ENV.fetch("PORT") { 3000 } + +# Specifies the `environment` that Puma will run in. +# +environment ENV.fetch("RAILS_ENV") { "development" } + +# Specifies the number of `workers` to boot in clustered mode. +# Workers are forked webserver processes. If using threads and workers together +# the concurrency of the application would be max `threads` * `workers`. +# Workers do not work on JRuby or Windows (both of which do not support +# processes). +# +# workers ENV.fetch("WEB_CONCURRENCY") { 2 } + +# Use the `preload_app!` method when specifying a `workers` number. +# This directive tells Puma to first boot the application and load code +# before forking the application. This takes advantage of Copy On Write +# process behavior so workers use less memory. +# +# preload_app! + +# Allow puma to be restarted by `rails restart` command. +plugin :tmp_restart diff --git a/config/routes.rb b/config/routes.rb new file mode 100644 index 000000000..787824f88 --- /dev/null +++ b/config/routes.rb @@ -0,0 +1,3 @@ +Rails.application.routes.draw do + # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html +end diff --git a/config/spring.rb b/config/spring.rb new file mode 100644 index 000000000..9fa7863f9 --- /dev/null +++ b/config/spring.rb @@ -0,0 +1,6 @@ +%w[ + .ruby-version + .rbenv-vars + tmp/restart.txt + tmp/caching-dev.txt +].each { |path| Spring.watch(path) } diff --git a/config/storage.yml b/config/storage.yml new file mode 100644 index 000000000..d32f76e8f --- /dev/null +++ b/config/storage.yml @@ -0,0 +1,34 @@ +test: + service: Disk + root: <%= Rails.root.join("tmp/storage") %> + +local: + service: Disk + root: <%= Rails.root.join("storage") %> + +# Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key) +# amazon: +# service: S3 +# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %> +# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %> +# region: us-east-1 +# bucket: your_own_bucket + +# Remember not to checkin your GCS keyfile to a repository +# google: +# service: GCS +# project: your_project +# credentials: <%= Rails.root.join("path/to/gcs.keyfile") %> +# bucket: your_own_bucket + +# Use rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key) +# microsoft: +# service: AzureStorage +# storage_account_name: your_account_name +# storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %> +# container: your_container_name + +# mirror: +# service: Mirror +# primary: local +# mirrors: [ amazon, google, microsoft ] diff --git a/db/seeds.rb b/db/seeds.rb new file mode 100644 index 000000000..1beea2acc --- /dev/null +++ b/db/seeds.rb @@ -0,0 +1,7 @@ +# This file should contain all the record creation needed to seed the database with its default values. +# The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup). +# +# Examples: +# +# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) +# Character.create(name: 'Luke', movie: movies.first) diff --git a/lib/assets/.keep b/lib/assets/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/lib/tasks/.keep b/lib/tasks/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/log/.keep b/log/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/log/development.log b/log/development.log new file mode 100644 index 000000000..732abda0f --- /dev/null +++ b/log/development.log @@ -0,0 +1,11 @@ +  (453.9ms) CREATE DATABASE "TaskList_development" ENCODING = 'unicode' + ↳ bin/rails:9 +  (345.7ms) CREATE DATABASE "TaskList_test" ENCODING = 'unicode' + ↳ bin/rails:9 +Started GET "/" for ::1 at 2019-04-08 14:19:46 -0700 +Processing by Rails::WelcomeController#index as HTML + Rendering /Users/kfasbender/.rvm/gems/ruby-2.5.1/gems/railties-5.2.3/lib/rails/templates/rails/welcome/index.html.erb + Rendered /Users/kfasbender/.rvm/gems/ruby-2.5.1/gems/railties-5.2.3/lib/rails/templates/rails/welcome/index.html.erb (3.3ms) +Completed 200 OK in 18ms (Views: 10.6ms | ActiveRecord: 0.0ms) + + diff --git a/package.json b/package.json new file mode 100644 index 000000000..f9cbc5515 --- /dev/null +++ b/package.json @@ -0,0 +1,5 @@ +{ + "name": "TaskList", + "private": true, + "dependencies": {} +} diff --git a/public/404.html b/public/404.html new file mode 100644 index 000000000..2be3af26f --- /dev/null +++ b/public/404.html @@ -0,0 +1,67 @@ + + + + The page you were looking for doesn't exist (404) + + + + + + +
+
+

The page you were looking for doesn't exist.

+

You may have mistyped the address or the page may have moved.

+
+

If you are the application owner check the logs for more information.

+
+ + diff --git a/public/422.html b/public/422.html new file mode 100644 index 000000000..c08eac0d1 --- /dev/null +++ b/public/422.html @@ -0,0 +1,67 @@ + + + + The change you wanted was rejected (422) + + + + + + +
+
+

The change you wanted was rejected.

+

Maybe you tried to change something you didn't have access to.

+
+

If you are the application owner check the logs for more information.

+
+ + diff --git a/public/500.html b/public/500.html new file mode 100644 index 000000000..78a030af2 --- /dev/null +++ b/public/500.html @@ -0,0 +1,66 @@ + + + + We're sorry, but something went wrong (500) + + + + + + +
+
+

We're sorry, but something went wrong.

+
+

If you are the application owner check the logs for more information.

+
+ + diff --git a/public/apple-touch-icon-precomposed.png b/public/apple-touch-icon-precomposed.png new file mode 100644 index 000000000..e69de29bb diff --git a/public/apple-touch-icon.png b/public/apple-touch-icon.png new file mode 100644 index 000000000..e69de29bb diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 000000000..e69de29bb diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 000000000..37b576a4a --- /dev/null +++ b/public/robots.txt @@ -0,0 +1 @@ +# See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file diff --git a/storage/.keep b/storage/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/test/application_system_test_case.rb b/test/application_system_test_case.rb new file mode 100644 index 000000000..d19212abd --- /dev/null +++ b/test/application_system_test_case.rb @@ -0,0 +1,5 @@ +require "test_helper" + +class ApplicationSystemTestCase < ActionDispatch::SystemTestCase + driven_by :selenium, using: :chrome, screen_size: [1400, 1400] +end diff --git a/test/fixtures/.keep b/test/fixtures/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/test/fixtures/files/.keep b/test/fixtures/files/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/test/helpers/.keep b/test/helpers/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/test/integration/.keep b/test/integration/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/test/mailers/.keep b/test/mailers/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/test/models/.keep b/test/models/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/test/system/.keep b/test/system/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/test/test_helper.rb b/test/test_helper.rb new file mode 100644 index 000000000..10594a324 --- /dev/null +++ b/test/test_helper.rb @@ -0,0 +1,26 @@ +ENV["RAILS_ENV"] = "test" +require File.expand_path("../../config/environment", __FILE__) +require "rails/test_help" +require "minitest/rails" +require "minitest/reporters" # for Colorized output + +# For colorful output! +Minitest::Reporters.use!( + Minitest::Reporters::SpecReporter.new, + ENV, + Minitest.backtrace_filter +) + + +# To add Capybara feature tests add `gem "minitest-rails-capybara"` +# to the test group in the Gemfile and uncomment the following: +# require "minitest/rails/capybara" + +# Uncomment for awesome colorful output +# require "minitest/pride" + +class ActiveSupport::TestCase + # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. + fixtures :all + # Add more helper methods to be used by all tests here... +end diff --git a/vendor/.keep b/vendor/.keep new file mode 100644 index 000000000..e69de29bb From 4a5e6276005a895b7d90df886284cb3a96c90f3e Mon Sep 17 00:00:00 2001 From: Kimberly-Fasbender Date: Mon, 8 Apr 2019 14:49:19 -0700 Subject: [PATCH 02/34] added Tasks Controller and its index action --- app/controllers/tasks_controller.rb | 7 +++ app/views/tasks/index.html.erb | 9 ++++ config/routes.rb | 1 + log/development.log | 77 +++++++++++++++++++++++++++++ log/test.log | 57 +++++++++++++++++++++ 5 files changed, 151 insertions(+) create mode 100644 app/views/tasks/index.html.erb create mode 100644 log/test.log diff --git a/app/controllers/tasks_controller.rb b/app/controllers/tasks_controller.rb index d180841e6..3e0e595a4 100644 --- a/app/controllers/tasks_controller.rb +++ b/app/controllers/tasks_controller.rb @@ -1,4 +1,11 @@ class TasksController < ApplicationController + TASKS = [ + {name: "Practice CSS"}, + {name: "Celebrate Wedding Anniversary"}, + {name: "Stress Eat!"}, + ] + def index + @tasks = TASKS end end diff --git a/app/views/tasks/index.html.erb b/app/views/tasks/index.html.erb new file mode 100644 index 000000000..0f2eed436 --- /dev/null +++ b/app/views/tasks/index.html.erb @@ -0,0 +1,9 @@ +

Task List

+ + diff --git a/config/routes.rb b/config/routes.rb index 787824f88..21d9d6d74 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,3 +1,4 @@ Rails.application.routes.draw do + get "/tasks", to: "tasks#index" # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html end diff --git a/log/development.log b/log/development.log index 732abda0f..ab9c46cb0 100644 --- a/log/development.log +++ b/log/development.log @@ -9,3 +9,80 @@ Processing by Rails::WelcomeController#index as HTML Completed 200 OK in 18ms (Views: 10.6ms | ActiveRecord: 0.0ms) +Started GET "/" for ::1 at 2019-04-08 14:25:15 -0700 +Processing by Rails::WelcomeController#index as HTML + Rendering /Users/kfasbender/.rvm/gems/ruby-2.5.1/gems/railties-5.2.3/lib/rails/templates/rails/welcome/index.html.erb + Rendered /Users/kfasbender/.rvm/gems/ruby-2.5.1/gems/railties-5.2.3/lib/rails/templates/rails/welcome/index.html.erb (1.8ms) +Completed 200 OK in 8ms (Views: 4.9ms | ActiveRecord: 0.0ms) + + +Started GET "/tasks" for ::1 at 2019-04-08 14:25:20 -0700 +Processing by TasksController#index as HTML +Completed 406 Not Acceptable in 102ms (ActiveRecord: 0.0ms) + + + +ActionController::UnknownFormat - TasksController#index is missing a template for this request format and variant. + +request.formats: ["text/html"] +request.variant: [] + +NOTE! For XHR/Ajax or API requests, this action would normally respond with 204 No Content: an empty white screen. Since you're loading it in a web browser, we assume that you expected to actually render a template, not nothing, so we're showing an error to be extra-clear. If you expect 204 No Content, carry on. That's what you'll get from an XHR or API request. Give it a shot.: + +Started POST "/__better_errors/6c0967427e0c7f91/variables" for ::1 at 2019-04-08 14:25:21 -0700 +Started GET "/tasks" for ::1 at 2019-04-08 14:26:29 -0700 +Processing by TasksController#index as HTML +Completed 406 Not Acceptable in 100ms (ActiveRecord: 0.0ms) + + + +ActionController::UnknownFormat - TasksController#index is missing a template for this request format and variant. + +request.formats: ["text/html"] +request.variant: [] + +NOTE! For XHR/Ajax or API requests, this action would normally respond with 204 No Content: an empty white screen. Since you're loading it in a web browser, we assume that you expected to actually render a template, not nothing, so we're showing an error to be extra-clear. If you expect 204 No Content, carry on. That's what you'll get from an XHR or API request. Give it a shot.: + +Started POST "/__better_errors/74e614c6a0757e7c/variables" for ::1 at 2019-04-08 14:26:30 -0700 +Started GET "/tasks" for ::1 at 2019-04-08 14:27:32 -0700 +Processing by TasksController#index as HTML +Completed 406 Not Acceptable in 98ms (ActiveRecord: 0.0ms) + + + +ActionController::UnknownFormat - TasksController#index is missing a template for this request format and variant. + +request.formats: ["text/html"] +request.variant: [] + +NOTE! For XHR/Ajax or API requests, this action would normally respond with 204 No Content: an empty white screen. Since you're loading it in a web browser, we assume that you expected to actually render a template, not nothing, so we're showing an error to be extra-clear. If you expect 204 No Content, carry on. That's what you'll get from an XHR or API request. Give it a shot.: + +Started POST "/__better_errors/057500c07200d772/variables" for ::1 at 2019-04-08 14:27:33 -0700 +Started GET "/tasks" for ::1 at 2019-04-08 14:29:31 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Rendered tasks/index.html.erb within layouts/application (0.8ms) +Completed 200 OK in 247ms (Views: 244.5ms | ActiveRecord: 0.0ms) + + +Started GET "/tasks" for ::1 at 2019-04-08 14:33:03 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Rendered tasks/index.html.erb within layouts/application (0.3ms) +Completed 200 OK in 21ms (Views: 18.5ms | ActiveRecord: 0.0ms) + + +Started GET "/tasks" for ::1 at 2019-04-08 14:34:25 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Rendered tasks/index.html.erb within layouts/application (0.4ms) +Completed 200 OK in 21ms (Views: 18.2ms | ActiveRecord: 0.0ms) + + +Started GET "/tasks" for ::1 at 2019-04-08 14:34:48 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Rendered tasks/index.html.erb within layouts/application (1.3ms) +Completed 200 OK in 186ms (Views: 180.2ms | ActiveRecord: 0.0ms) + + diff --git a/log/test.log b/log/test.log new file mode 100644 index 000000000..f2c8b3796 --- /dev/null +++ b/log/test.log @@ -0,0 +1,57 @@ +  (200.0ms) DROP DATABASE IF EXISTS "TaskList_test" +  (504.4ms) CREATE DATABASE "TaskList_test" ENCODING = 'unicode' +  (0.2ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-08 14:38:16 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Rendered tasks/index.html.erb within layouts/application (1.1ms) +Completed 200 OK in 250ms (Views: 244.2ms | ActiveRecord: 0.0ms) +  (0.3ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.2ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +  (0.1ms) ROLLBACK From 2bbed10bbdb6505ea04a92b68af23ff9beed0ca0 Mon Sep 17 00:00:00 2001 From: Kimberly-Fasbender Date: Mon, 8 Apr 2019 15:03:31 -0700 Subject: [PATCH 03/34] tests --- log/development.log | 14 ++++++ log/test.log | 114 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 128 insertions(+) diff --git a/log/development.log b/log/development.log index ab9c46cb0..55fb68e81 100644 --- a/log/development.log +++ b/log/development.log @@ -86,3 +86,17 @@ Processing by TasksController#index as HTML Completed 200 OK in 186ms (Views: 180.2ms | ActiveRecord: 0.0ms) +Started GET "/" for ::1 at 2019-04-08 14:56:00 -0700 +Processing by Rails::WelcomeController#index as HTML + Rendering /Users/kfasbender/.rvm/gems/ruby-2.5.1/gems/railties-5.2.3/lib/rails/templates/rails/welcome/index.html.erb + Rendered /Users/kfasbender/.rvm/gems/ruby-2.5.1/gems/railties-5.2.3/lib/rails/templates/rails/welcome/index.html.erb (2.3ms) +Completed 200 OK in 17ms (Views: 10.4ms | ActiveRecord: 0.0ms) + + +Started GET "/tasks" for ::1 at 2019-04-08 14:56:05 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Rendered tasks/index.html.erb within layouts/application (0.6ms) +Completed 200 OK in 175ms (Views: 172.7ms | ActiveRecord: 0.0ms) + + diff --git a/log/test.log b/log/test.log index f2c8b3796..ba40e09f0 100644 --- a/log/test.log +++ b/log/test.log @@ -55,3 +55,117 @@ TasksController::show: test_0001_can get a valid task TasksController::show: test_0002_will redirect for an invalid task ------------------------------------------------------------------  (0.1ms) ROLLBACK +  (214.0ms) DROP DATABASE IF EXISTS "TaskList_test" +  (453.3ms) CREATE DATABASE "TaskList_test" ENCODING = 'unicode' +  (0.2ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-08 14:54:44 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Rendered tasks/index.html.erb within layouts/application (1.2ms) +Completed 200 OK in 181ms (Views: 175.1ms | ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.2ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.2ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (0.1ms) ROLLBACK +  (196.4ms) DROP DATABASE IF EXISTS "TaskList_test" +  (348.8ms) CREATE DATABASE "TaskList_test" ENCODING = 'unicode' +  (0.2ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-08 14:56:14 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Rendered tasks/index.html.erb within layouts/application (0.7ms) +Completed 200 OK in 205ms (Views: 198.8ms | ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +  (0.1ms) ROLLBACK From 2a1c0a82982bee294431b241a73d728ee59bfa5e Mon Sep 17 00:00:00 2001 From: Kimberly-Fasbender Date: Tue, 9 Apr 2019 15:55:26 -0700 Subject: [PATCH 04/34] added Task model, migration to update completion_date column, added 2 Tasks to the database, and added the show action to the Task Controller --- .ruby-version | 2 +- Gemfile | 2 +- app/controllers/tasks_controller.rb | 15 +- app/models/task.rb | 2 + app/views/layouts/application.html.erb | 5 + app/views/tasks/index.html.erb | 3 +- app/views/tasks/show.html.erb | 7 + config/routes.rb | 1 + db/migrate/20190409214340_create_tasks.rb | 11 + ...20629_remove_completion_date_from_tasks.rb | 5 + ...0409221101_add_completion_date_to_tasks.rb | 5 + db/schema.rb | 26 ++ log/development.log | 342 ++++++++++++++++++ log/test.log | 300 +++++++++++++++ test/controllers/tasks_controller_test.rb | 1 - test/fixtures/tasks.yml | 11 + test/models/task_test.rb | 9 + 17 files changed, 735 insertions(+), 12 deletions(-) create mode 100644 app/models/task.rb create mode 100644 app/views/tasks/show.html.erb create mode 100644 db/migrate/20190409214340_create_tasks.rb create mode 100644 db/migrate/20190409220629_remove_completion_date_from_tasks.rb create mode 100644 db/migrate/20190409221101_add_completion_date_to_tasks.rb create mode 100644 db/schema.rb create mode 100644 test/fixtures/tasks.yml create mode 100644 test/models/task_test.rb diff --git a/.ruby-version b/.ruby-version index 25c81fe39..d4bcea958 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -ruby-2.5.1 \ No newline at end of file +ruby-2.5.3 diff --git a/Gemfile b/Gemfile index e665f46d3..4dfe799be 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" } -ruby '2.5.1' +ruby '2.5.3' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 5.2.3' diff --git a/app/controllers/tasks_controller.rb b/app/controllers/tasks_controller.rb index 3e0e595a4..075e90313 100644 --- a/app/controllers/tasks_controller.rb +++ b/app/controllers/tasks_controller.rb @@ -1,11 +1,12 @@ class TasksController < ApplicationController - TASKS = [ - {name: "Practice CSS"}, - {name: "Celebrate Wedding Anniversary"}, - {name: "Stress Eat!"}, - ] - def index - @tasks = TASKS + @tasks = Task.all + end + + def show + task_id = params[:id].to_i + @task = Task.find_by(id: task_id) + + head :not_found if @task.nil? end end diff --git a/app/models/task.rb b/app/models/task.rb new file mode 100644 index 000000000..3c2342421 --- /dev/null +++ b/app/models/task.rb @@ -0,0 +1,2 @@ +class Task < ApplicationRecord +end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index b9ce64348..f7e03c096 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -10,6 +10,11 @@ +
+

Task List

+
+
<%= yield %> +
diff --git a/app/views/tasks/index.html.erb b/app/views/tasks/index.html.erb index 0f2eed436..e1d23de2f 100644 --- a/app/views/tasks/index.html.erb +++ b/app/views/tasks/index.html.erb @@ -1,9 +1,8 @@ -

Task List

    <% @tasks.each do |task| %>
  • - <%= task[:name] %> + <%= task.name %>
  • <% end %>
diff --git a/app/views/tasks/show.html.erb b/app/views/tasks/show.html.erb new file mode 100644 index 000000000..11f7fc660 --- /dev/null +++ b/app/views/tasks/show.html.erb @@ -0,0 +1,7 @@ +

+ <%= @task.name %> +

+ +

+ <%= @task.description %> +

diff --git a/config/routes.rb b/config/routes.rb index 21d9d6d74..13693563d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,4 +1,5 @@ Rails.application.routes.draw do get "/tasks", to: "tasks#index" + get "/tasks/:id", to: "tasks#show" # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html end diff --git a/db/migrate/20190409214340_create_tasks.rb b/db/migrate/20190409214340_create_tasks.rb new file mode 100644 index 000000000..0056cd7eb --- /dev/null +++ b/db/migrate/20190409214340_create_tasks.rb @@ -0,0 +1,11 @@ +class CreateTasks < ActiveRecord::Migration[5.2] + def change + create_table :tasks do |t| + t.string :name + t.string :description + t.string :completion_date + + t.timestamps + end + end +end diff --git a/db/migrate/20190409220629_remove_completion_date_from_tasks.rb b/db/migrate/20190409220629_remove_completion_date_from_tasks.rb new file mode 100644 index 000000000..3bacb7aae --- /dev/null +++ b/db/migrate/20190409220629_remove_completion_date_from_tasks.rb @@ -0,0 +1,5 @@ +class RemoveCompletionDateFromTasks < ActiveRecord::Migration[5.2] + def change + remove_column :tasks, :completion_date, :string + end +end diff --git a/db/migrate/20190409221101_add_completion_date_to_tasks.rb b/db/migrate/20190409221101_add_completion_date_to_tasks.rb new file mode 100644 index 000000000..7e3cf3a7a --- /dev/null +++ b/db/migrate/20190409221101_add_completion_date_to_tasks.rb @@ -0,0 +1,5 @@ +class AddCompletionDateToTasks < ActiveRecord::Migration[5.2] + def change + add_column :tasks, :completion_date, :datetime + end +end diff --git a/db/schema.rb b/db/schema.rb new file mode 100644 index 000000000..039afb90b --- /dev/null +++ b/db/schema.rb @@ -0,0 +1,26 @@ +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# Note that this schema.rb definition is the authoritative source for your +# database schema. If you need to create the application database on another +# system, you should be using db:schema:load, not running all the migrations +# from scratch. The latter is a flawed and unsustainable approach (the more migrations +# you'll amass, the slower it'll run and the greater likelihood for issues). +# +# It's strongly recommended that you check this file into your version control system. + +ActiveRecord::Schema.define(version: 2019_04_09_221101) do + + # These are extensions that must be enabled in order to support this database + enable_extension "plpgsql" + + create_table "tasks", force: :cascade do |t| + t.string "name" + t.string "description" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.datetime "completion_date" + end + +end diff --git a/log/development.log b/log/development.log index 55fb68e81..86f4ecd12 100644 --- a/log/development.log +++ b/log/development.log @@ -100,3 +100,345 @@ Processing by TasksController#index as HTML Completed 200 OK in 175ms (Views: 172.7ms | ActiveRecord: 0.0ms) +Started GET "/books" for ::1 at 2019-04-09 14:23:56 -0700 + +ActionController::RoutingError (No route matches [GET] "/books"): + +actionpack (5.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:65:in `call' +web-console (3.7.0) lib/web_console/middleware.rb:135:in `call_app' +web-console (3.7.0) lib/web_console/middleware.rb:30:in `block in call' +web-console (3.7.0) lib/web_console/middleware.rb:20:in `catch' +web-console (3.7.0) lib/web_console/middleware.rb:20:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call' +railties (5.2.3) lib/rails/rack/logger.rb:38:in `call_app' +railties (5.2.3) lib/rails/rack/logger.rb:26:in `block in call' +activesupport (5.2.3) lib/active_support/tagged_logging.rb:71:in `block in tagged' +activesupport (5.2.3) lib/active_support/tagged_logging.rb:28:in `tagged' +activesupport (5.2.3) lib/active_support/tagged_logging.rb:71:in `tagged' +railties (5.2.3) lib/rails/rack/logger.rb:26:in `call' +sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/remote_ip.rb:81:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/request_id.rb:27:in `call' +rack (2.0.7) lib/rack/method_override.rb:22:in `call' +rack (2.0.7) lib/rack/runtime.rb:22:in `call' +activesupport (5.2.3) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/executor.rb:14:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/static.rb:127:in `call' +rack (2.0.7) lib/rack/sendfile.rb:111:in `call' +railties (5.2.3) lib/rails/engine.rb:524:in `call' +puma (3.12.1) lib/puma/configuration.rb:227:in `call' +puma (3.12.1) lib/puma/server.rb:660:in `handle_request' +puma (3.12.1) lib/puma/server.rb:474:in `process_client' +puma (3.12.1) lib/puma/server.rb:334:in `block in run' +puma (3.12.1) lib/puma/thread_pool.rb:135:in `block in spawn_thread' +Started GET "/" for ::1 at 2019-04-09 14:24:01 -0700 +Processing by Rails::WelcomeController#index as HTML + Rendering /Users/kfasbender/.rvm/gems/ruby-2.5.1/gems/railties-5.2.3/lib/rails/templates/rails/welcome/index.html.erb + Rendered /Users/kfasbender/.rvm/gems/ruby-2.5.1/gems/railties-5.2.3/lib/rails/templates/rails/welcome/index.html.erb (2.0ms) +Completed 200 OK in 9ms (Views: 5.1ms | ActiveRecord: 0.0ms) + + +Started GET "/tasks" for ::1 at 2019-04-09 14:24:23 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Rendered tasks/index.html.erb within layouts/application (0.8ms) +Completed 200 OK in 208ms (Views: 205.6ms | ActiveRecord: 0.0ms) + + +Started GET "/tasks" for ::1 at 2019-04-09 14:30:13 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Rendered tasks/index.html.erb within layouts/application (0.7ms) +Completed 200 OK in 176ms (Views: 169.8ms | ActiveRecord: 0.0ms) + + +  (29.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY) + ↳ bin/rails:9 +  (7.6ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) + ↳ bin/rails:9 +  (0.7ms) SELECT pg_try_advisory_lock(4169262226251541860) + ↳ bin/rails:9 +  (1.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC + ↳ bin/rails:9 +Migrating to CreateTasks (20190409214340) +  (0.2ms) BEGIN + ↳ bin/rails:9 +  (7.9ms) CREATE TABLE "tasks" ("id" bigserial primary key, "name" character varying, "description" character varying, "completion_date" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) + ↳ db/migrate/20190409214340_create_tasks.rb:3 + ActiveRecord::SchemaMigration Create (0.5ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20190409214340"]] + ↳ bin/rails:9 +  (4.5ms) COMMIT + ↳ bin/rails:9 + ActiveRecord::InternalMetadata Load (0.3ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]] + ↳ bin/rails:9 +  (0.1ms) BEGIN + ↳ bin/rails:9 + ActiveRecord::InternalMetadata Create (0.3ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2019-04-09 21:46:25.070151"], ["updated_at", "2019-04-09 21:46:25.070151"]] + ↳ bin/rails:9 +  (0.3ms) COMMIT + ↳ bin/rails:9 +  (0.2ms) SELECT pg_advisory_unlock(4169262226251541860) + ↳ bin/rails:9 +  (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC + ↳ bin/rails:9 +  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC + ↳ bin/rails:9 +  (0.2ms) SELECT pg_try_advisory_lock(4169262226251541860) + ↳ bin/rails:9 +  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC + ↳ bin/rails:9 +Migrating to RemoveCompletionDateFromTasks (20190409220629) +  (0.2ms) BEGIN + ↳ bin/rails:9 +  (0.1ms) ROLLBACK + ↳ bin/rails:9 +  (0.2ms) SELECT pg_advisory_unlock(4169262226251541860) + ↳ bin/rails:9 +  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC + ↳ bin/rails:9 +  (0.1ms) SELECT pg_try_advisory_lock(4169262226251541860) + ↳ bin/rails:9 +  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC + ↳ bin/rails:9 +Migrating to RemoveCompletionDateFromTasks (20190409220629) +  (0.1ms) BEGIN + ↳ bin/rails:9 +  (7.9ms) ALTER TABLE "tasks" DROP COLUMN "completion_date" + ↳ db/migrate/20190409220629_remove_completion_date_from_tasks.rb:3 + ActiveRecord::SchemaMigration Create (1.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20190409220629"]] + ↳ bin/rails:9 +  (0.5ms) COMMIT + ↳ bin/rails:9 + ActiveRecord::InternalMetadata Load (5.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]] + ↳ bin/rails:9 +  (0.2ms) BEGIN + ↳ bin/rails:9 +  (0.2ms) COMMIT + ↳ bin/rails:9 +  (0.5ms) SELECT pg_advisory_unlock(4169262226251541860) + ↳ bin/rails:9 +  (0.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC + ↳ bin/rails:9 +  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC + ↳ bin/rails:9 +  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC + ↳ bin/rails:9 +  (0.1ms) SELECT pg_try_advisory_lock(4169262226251541860) + ↳ bin/rails:9 +  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC + ↳ bin/rails:9 +Migrating to AddCompletionDateToTasks (20190409221101) +  (0.1ms) BEGIN + ↳ bin/rails:9 +  (0.7ms) ALTER TABLE "tasks" ADD "completion_date" timestamp + ↳ db/migrate/20190409221101_add_completion_date_to_tasks.rb:3 + ActiveRecord::SchemaMigration Create (0.5ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20190409221101"]] + ↳ bin/rails:9 +  (0.5ms) COMMIT + ↳ bin/rails:9 + ActiveRecord::InternalMetadata Load (0.3ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]] + ↳ bin/rails:9 +  (0.2ms) BEGIN + ↳ bin/rails:9 +  (0.1ms) COMMIT + ↳ bin/rails:9 +  (0.2ms) SELECT pg_advisory_unlock(4169262226251541860) + ↳ bin/rails:9 +  (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC + ↳ bin/rails:9 +  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC + ↳ bin/rails:9 +  (0.1ms) BEGIN + Task Create (1.2ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Stress Eat"], ["description", "Find as much ice cream as you can and shove it uncerimoniously into your mouth!"], ["created_at", "2019-04-09 22:18:37.306141"], ["updated_at", "2019-04-09 22:18:37.306141"]] +  (0.4ms) COMMIT +  (0.3ms) BEGIN + Task Create (0.4ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Practice Rails"], ["description", "Break all the things, google all the things, ask all the questions."], ["created_at", "2019-04-09 22:19:34.777097"], ["updated_at", "2019-04-09 22:19:34.777097"]] +  (0.7ms) COMMIT + Task Load (0.5ms) SELECT "tasks".* FROM "tasks" +Started GET "/tasks" for ::1 at 2019-04-09 15:20:47 -0700 +  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC + ↳ /Users/kfasbender/.rvm/gems/ruby-2.5.3/gems/activerecord-5.2.3/lib/active_record/log_subscriber.rb:98 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Rendered tasks/index.html.erb within layouts/application (1.8ms) +Completed 200 OK in 264ms (Views: 258.9ms | ActiveRecord: 0.0ms) + + +Started GET "/tasks" for ::1 at 2019-04-09 15:22:04 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.5ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:4 + Rendered tasks/index.html.erb within layouts/application (9.2ms) +Completed 200 OK in 27ms (Views: 19.4ms | ActiveRecord: 3.9ms) + + +Started GET "/tasks" for ::1 at 2019-04-09 15:43:01 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.6ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:4 + Rendered tasks/index.html.erb within layouts/application (10.7ms) +Completed 200 OK in 28ms (Views: 19.7ms | ActiveRecord: 5.1ms) + + +Started GET "/1" for ::1 at 2019-04-09 15:43:05 -0700 + +ActionController::RoutingError (No route matches [GET] "/1"): + +actionpack (5.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:65:in `call' +web-console (3.7.0) lib/web_console/middleware.rb:135:in `call_app' +web-console (3.7.0) lib/web_console/middleware.rb:30:in `block in call' +web-console (3.7.0) lib/web_console/middleware.rb:20:in `catch' +web-console (3.7.0) lib/web_console/middleware.rb:20:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call' +railties (5.2.3) lib/rails/rack/logger.rb:38:in `call_app' +railties (5.2.3) lib/rails/rack/logger.rb:26:in `block in call' +activesupport (5.2.3) lib/active_support/tagged_logging.rb:71:in `block in tagged' +activesupport (5.2.3) lib/active_support/tagged_logging.rb:28:in `tagged' +activesupport (5.2.3) lib/active_support/tagged_logging.rb:71:in `tagged' +railties (5.2.3) lib/rails/rack/logger.rb:26:in `call' +sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/remote_ip.rb:81:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/request_id.rb:27:in `call' +rack (2.0.7) lib/rack/method_override.rb:22:in `call' +rack (2.0.7) lib/rack/runtime.rb:22:in `call' +activesupport (5.2.3) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/executor.rb:14:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/static.rb:127:in `call' +rack (2.0.7) lib/rack/sendfile.rb:111:in `call' +railties (5.2.3) lib/rails/engine.rb:524:in `call' +puma (3.12.1) lib/puma/configuration.rb:227:in `call' +puma (3.12.1) lib/puma/server.rb:660:in `handle_request' +puma (3.12.1) lib/puma/server.rb:474:in `process_client' +puma (3.12.1) lib/puma/server.rb:334:in `block in run' +puma (3.12.1) lib/puma/thread_pool.rb:135:in `block in spawn_thread' +Started GET "/1" for ::1 at 2019-04-09 15:44:06 -0700 + +ActionController::RoutingError (No route matches [GET] "/1"): + +actionpack (5.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:65:in `call' +web-console (3.7.0) lib/web_console/middleware.rb:135:in `call_app' +web-console (3.7.0) lib/web_console/middleware.rb:30:in `block in call' +web-console (3.7.0) lib/web_console/middleware.rb:20:in `catch' +web-console (3.7.0) lib/web_console/middleware.rb:20:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call' +railties (5.2.3) lib/rails/rack/logger.rb:38:in `call_app' +railties (5.2.3) lib/rails/rack/logger.rb:26:in `block in call' +activesupport (5.2.3) lib/active_support/tagged_logging.rb:71:in `block in tagged' +activesupport (5.2.3) lib/active_support/tagged_logging.rb:28:in `tagged' +activesupport (5.2.3) lib/active_support/tagged_logging.rb:71:in `tagged' +railties (5.2.3) lib/rails/rack/logger.rb:26:in `call' +sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/remote_ip.rb:81:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/request_id.rb:27:in `call' +rack (2.0.7) lib/rack/method_override.rb:22:in `call' +rack (2.0.7) lib/rack/runtime.rb:22:in `call' +activesupport (5.2.3) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/executor.rb:14:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/static.rb:127:in `call' +rack (2.0.7) lib/rack/sendfile.rb:111:in `call' +railties (5.2.3) lib/rails/engine.rb:524:in `call' +puma (3.12.1) lib/puma/configuration.rb:227:in `call' +puma (3.12.1) lib/puma/server.rb:660:in `handle_request' +puma (3.12.1) lib/puma/server.rb:474:in `process_client' +puma (3.12.1) lib/puma/server.rb:334:in `block in run' +puma (3.12.1) lib/puma/thread_pool.rb:135:in `block in spawn_thread' +Started GET "/1" for ::1 at 2019-04-09 15:45:03 -0700 + +ActionController::RoutingError (No route matches [GET] "/1"): + +actionpack (5.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:65:in `call' +web-console (3.7.0) lib/web_console/middleware.rb:135:in `call_app' +web-console (3.7.0) lib/web_console/middleware.rb:30:in `block in call' +web-console (3.7.0) lib/web_console/middleware.rb:20:in `catch' +web-console (3.7.0) lib/web_console/middleware.rb:20:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call' +railties (5.2.3) lib/rails/rack/logger.rb:38:in `call_app' +railties (5.2.3) lib/rails/rack/logger.rb:26:in `block in call' +activesupport (5.2.3) lib/active_support/tagged_logging.rb:71:in `block in tagged' +activesupport (5.2.3) lib/active_support/tagged_logging.rb:28:in `tagged' +activesupport (5.2.3) lib/active_support/tagged_logging.rb:71:in `tagged' +railties (5.2.3) lib/rails/rack/logger.rb:26:in `call' +sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/remote_ip.rb:81:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/request_id.rb:27:in `call' +rack (2.0.7) lib/rack/method_override.rb:22:in `call' +rack (2.0.7) lib/rack/runtime.rb:22:in `call' +activesupport (5.2.3) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/executor.rb:14:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/static.rb:127:in `call' +rack (2.0.7) lib/rack/sendfile.rb:111:in `call' +railties (5.2.3) lib/rails/engine.rb:524:in `call' +puma (3.12.1) lib/puma/configuration.rb:227:in `call' +puma (3.12.1) lib/puma/server.rb:660:in `handle_request' +puma (3.12.1) lib/puma/server.rb:474:in `process_client' +puma (3.12.1) lib/puma/server.rb:334:in `block in run' +puma (3.12.1) lib/puma/thread_pool.rb:135:in `block in spawn_thread' +Started GET "/tasks" for ::1 at 2019-04-09 15:45:09 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:4 + Rendered tasks/index.html.erb within layouts/application (10.4ms) +Completed 200 OK in 35ms (Views: 26.8ms | ActiveRecord: 4.0ms) + + +Started GET "/tasks/1" for ::1 at 2019-04-09 15:45:10 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"1"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.4ms) +Completed 200 OK in 25ms (Views: 20.3ms | ActiveRecord: 0.5ms) + + +Started GET "/tasks/2" for ::1 at 2019-04-09 15:45:23 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"2"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 2], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (1.0ms) +Completed 200 OK in 29ms (Views: 25.5ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/2" for ::1 at 2019-04-09 15:47:24 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"2"} + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 2], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.4ms) +Completed 200 OK in 29ms (Views: 24.5ms | ActiveRecord: 0.4ms) + + +Started GET "/tasks/2" for ::1 at 2019-04-09 15:47:48 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"2"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 2], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.4ms) +Completed 200 OK in 26ms (Views: 22.4ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 15:48:04 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:4 + Rendered tasks/index.html.erb within layouts/application (1.7ms) +Completed 200 OK in 28ms (Views: 24.8ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 15:48:17 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.6ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (2.3ms) +Completed 200 OK in 26ms (Views: 23.8ms | ActiveRecord: 0.6ms) + + diff --git a/log/test.log b/log/test.log index ba40e09f0..a3bb0e003 100644 --- a/log/test.log +++ b/log/test.log @@ -169,3 +169,303 @@ Completed 200 OK in 205ms (Views: 198.8ms | ActiveRecord: 0.0ms) TasksController::index: test_0002_can get the root path -------------------------------------------------------  (0.1ms) ROLLBACK +  (211.7ms) DROP DATABASE IF EXISTS "TaskList_test" +  (376.6ms) CREATE DATABASE "TaskList_test" ENCODING = 'unicode' +  (0.3ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-09 09:15:35 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Rendered tasks/index.html.erb within layouts/application (1.5ms) +Completed 200 OK in 156ms (Views: 150.4ms | ActiveRecord: 0.0ms) +  (0.3ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +  (0.1ms) ROLLBACK +  (144.7ms) DROP DATABASE IF EXISTS "TaskList_test" +  (393.7ms) CREATE DATABASE "TaskList_test" ENCODING = 'unicode' + SQL (0.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql" +  (0.9ms) DROP TABLE IF EXISTS "tasks" CASCADE +  (4.8ms) CREATE TABLE "tasks" ("id" bigserial primary key, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "completion_date" timestamp) +  (1.7ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY) +  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES (20190409221101) +  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES +(20190409220629), +(20190409214340); + + +  (1.8ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) + ActiveRecord::InternalMetadata Load (0.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]] +  (0.1ms) BEGIN + ActiveRecord::InternalMetadata Create (0.5ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "test"], ["created_at", "2019-04-09 22:25:37.096279"], ["updated_at", "2019-04-09 22:25:37.096279"]] +  (0.3ms) COMMIT + ActiveRecord::InternalMetadata Load (0.3ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]] +  (0.1ms) BEGIN +  (0.1ms) COMMIT +  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.2ms) BEGIN +  (1.6ms) ALTER TABLE "tasks" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN + Fixtures Load (1.2ms) DELETE FROM "tasks"; +INSERT INTO "tasks" ("id", "name", "description", "created_at", "updated_at", "completion_date") VALUES (980190962, 'MyString', 'MyString', '2019-04-09 22:25:37.407370', '2019-04-09 22:25:37.407370', NULL), (298486374, 'MyString', 'MyString', '2019-04-09 22:25:37.407370', '2019-04-09 22:25:37.407370', NULL) +  (0.4ms) COMMIT +  (0.1ms) BEGIN +  (0.2ms) ALTER TABLE "tasks" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL +  (0.2ms) COMMIT +  (0.1ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +  (0.1ms) ROLLBACK +  (0.8ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-09 15:25:37 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (9.5ms) +Completed 200 OK in 242ms (Views: 236.3ms | ActiveRecord: 0.3ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.2ms) BEGIN +----------------------------- +Task: test_0001_must be valid +----------------------------- +  (0.1ms) ROLLBACK +  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.1ms) BEGIN +  (0.3ms) ALTER TABLE "tasks" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN + Fixtures Load (0.6ms) DELETE FROM "tasks"; +INSERT INTO "tasks" ("id", "name", "description", "created_at", "updated_at", "completion_date") VALUES (980190962, 'MyString', 'MyString', '2019-04-09 22:26:58.367496', '2019-04-09 22:26:58.367496', NULL), (298486374, 'MyString', 'MyString', '2019-04-09 22:26:58.367496', '2019-04-09 22:26:58.367496', NULL) +  (0.6ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) ALTER TABLE "tasks" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-09 15:26:58 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (7.2ms) +Completed 200 OK in 171ms (Views: 165.0ms | ActiveRecord: 0.3ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.2ms) SAVEPOINT active_record_1 + Task Create (0.3ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at", "completion_date") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["name", "sample task"], ["description", "this is an example for a test"], ["created_at", "2019-04-09 22:26:58.624479"], ["updated_at", "2019-04-09 22:26:58.624479"], ["completion_date", "2019-04-14 22:26:58.620923"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.2ms) ROLLBACK +  (0.2ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------- +Task: test_0001_must be valid +----------------------------- +  (0.1ms) ROLLBACK +  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.1ms) BEGIN +  (0.3ms) ALTER TABLE "tasks" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN + Fixtures Load (1.2ms) DELETE FROM "tasks"; +INSERT INTO "tasks" ("id", "name", "description", "created_at", "updated_at", "completion_date") VALUES (980190962, 'MyString', 'MyString', '2019-04-09 22:49:44.509910', '2019-04-09 22:49:44.509910', NULL), (298486374, 'MyString', 'MyString', '2019-04-09 22:49:44.509910', '2019-04-09 22:49:44.509910', NULL) +  (0.4ms) COMMIT +  (0.1ms) BEGIN +  (0.2ms) ALTER TABLE "tasks" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL +  (0.2ms) COMMIT +  (0.1ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.2ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-09 15:49:44 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (7.1ms) +Completed 200 OK in 169ms (Views: 163.7ms | ActiveRecord: 0.3ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------- +Task: test_0001_must be valid +----------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.2ms) SAVEPOINT active_record_1 + Task Create (0.4ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at", "completion_date") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["name", "sample task"], ["description", "this is an example for a test"], ["created_at", "2019-04-09 22:49:44.780186"], ["updated_at", "2019-04-09 22:49:44.780186"], ["completion_date", "2019-04-14 22:49:44.778450"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.2ms) ROLLBACK +  (0.2ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +  (0.1ms) ROLLBACK diff --git a/test/controllers/tasks_controller_test.rb b/test/controllers/tasks_controller_test.rb index 971913898..bbec7320e 100644 --- a/test/controllers/tasks_controller_test.rb +++ b/test/controllers/tasks_controller_test.rb @@ -28,7 +28,6 @@ # Unskip these tests for Wave 2 describe "show" do it "can get a valid task" do - skip # Act get task_path(task.id) diff --git a/test/fixtures/tasks.yml b/test/fixtures/tasks.yml new file mode 100644 index 000000000..b1a33887c --- /dev/null +++ b/test/fixtures/tasks.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + name: MyString + description: MyString + completion_date: MyString + +two: + name: MyString + description: MyString + completion_date: MyString diff --git a/test/models/task_test.rb b/test/models/task_test.rb new file mode 100644 index 000000000..7928a374f --- /dev/null +++ b/test/models/task_test.rb @@ -0,0 +1,9 @@ +require "test_helper" + +describe Task do + let(:task) { Task.new } + + it "must be valid" do + value(task).must_be :valid? + end +end From 5685da359859e323dbd6fa122c680a384ce0cb91 Mon Sep 17 00:00:00 2001 From: Kimberly-Fasbender Date: Tue, 9 Apr 2019 16:29:28 -0700 Subject: [PATCH 05/34] added route for Tasks#show and updated html and css --- app/assets/stylesheets/application.css | 10 ++ app/views/layouts/application.html.erb | 5 +- app/views/tasks/index.html.erb | 6 +- config/routes.rb | 1 + log/development.log | 153 ++++++++++++++++++++++ log/test.log | 147 +++++++++++++++++++++ test/controllers/tasks_controller_test.rb | 1 + 7 files changed, 320 insertions(+), 3 deletions(-) diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index d05ea0f51..93f2138f6 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -13,3 +13,13 @@ *= require_tree . *= require_self */ + + h1 { + color: tomato; + text-align: center; + } + + body { + background: lightcyan; + margin: 5rem; + } diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index f7e03c096..b5510cb02 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -14,7 +14,10 @@

Task List

- <%= yield %> + <%= yield %>
+
+ © Kim Fasbender 2019 +
diff --git a/app/views/tasks/index.html.erb b/app/views/tasks/index.html.erb index e1d23de2f..0ef016519 100644 --- a/app/views/tasks/index.html.erb +++ b/app/views/tasks/index.html.erb @@ -1,8 +1,10 @@ - +

Your Tasks

diff --git a/config/routes.rb b/config/routes.rb index 13693563d..fa5faee75 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,5 +1,6 @@ Rails.application.routes.draw do get "/tasks", to: "tasks#index" + get "/tasks/:id", to: "tasks#show" # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html end diff --git a/log/development.log b/log/development.log index 86f4ecd12..227e64823 100644 --- a/log/development.log +++ b/log/development.log @@ -442,3 +442,156 @@ Processing by TasksController#index as HTML Completed 200 OK in 26ms (Views: 23.8ms | ActiveRecord: 0.6ms) +Started GET "/tasks/" for ::1 at 2019-04-09 15:58:14 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.6ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.8ms) +Completed 200 OK in 41ms (Views: 37.8ms | ActiveRecord: 0.6ms) + + +Started GET "/tasks/1" for ::1 at 2019-04-09 15:58:20 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"1"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.4ms) +Completed 200 OK in 20ms (Views: 16.4ms | ActiveRecord: 0.5ms) + + +Started GET "/tasks/1" for ::1 at 2019-04-09 15:58:34 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"1"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.3ms) +Completed 200 OK in 28ms (Views: 24.7ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/1" for ::1 at 2019-04-09 15:58:44 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"1"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.3ms) +Completed 200 OK in 26ms (Views: 23.2ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/1" for ::1 at 2019-04-09 15:59:04 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"1"} + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.5ms) +Completed 200 OK in 39ms (Views: 35.1ms | ActiveRecord: 0.4ms) + + +Started GET "/tasks/1" for ::1 at 2019-04-09 15:59:17 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"1"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.5ms) +Completed 200 OK in 31ms (Views: 28.2ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/1" for ::1 at 2019-04-09 15:59:54 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"1"} + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.3ms) +Completed 200 OK in 28ms (Views: 24.4ms | ActiveRecord: 0.4ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 16:00:42 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (2.0ms) +Completed 200 OK in 21ms (Views: 18.8ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 16:01:06 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:4 + Rendered tasks/index.html.erb within layouts/application (1.1ms) +Completed 200 OK in 21ms (Views: 18.3ms | ActiveRecord: 0.2ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 16:02:10 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:4 + Rendered tasks/index.html.erb within layouts/application (1.2ms) +Completed 200 OK in 26ms (Views: 22.7ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 16:05:27 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:4 + Rendered tasks/index.html.erb within layouts/application (1.5ms) +Completed 200 OK in 20ms (Views: 17.8ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/1" for ::1 at 2019-04-09 16:05:30 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"1"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.6ms) +Completed 200 OK in 28ms (Views: 23.7ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/2" for ::1 at 2019-04-09 16:05:34 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"2"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 2], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.5ms) +Completed 200 OK in 25ms (Views: 20.9ms | ActiveRecord: 0.2ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 16:08:12 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.6ms) +Completed 200 OK in 20ms (Views: 17.5ms | ActiveRecord: 0.4ms) + + +Started GET "/tasks/1" for ::1 at 2019-04-09 16:08:13 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"1"} + Task Load (0.5ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.5ms) +Completed 200 OK in 30ms (Views: 25.8ms | ActiveRecord: 0.5ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 16:20:25 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.6ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (10.9ms) +Completed 200 OK in 29ms (Views: 20.5ms | ActiveRecord: 5.2ms) + + diff --git a/log/test.log b/log/test.log index a3bb0e003..4a7bfd635 100644 --- a/log/test.log +++ b/log/test.log @@ -469,3 +469,150 @@ TasksController::edit: test_0001_can get the edit page for an existing task TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task ------------------------------------------------------------------------------------------------------  (0.1ms) ROLLBACK +  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.2ms) BEGIN +  (0.3ms) ALTER TABLE "tasks" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN + Fixtures Load (0.5ms) DELETE FROM "tasks"; +INSERT INTO "tasks" ("id", "name", "description", "created_at", "updated_at", "completion_date") VALUES (980190962, 'MyString', 'MyString', '2019-04-09 23:06:59.125197', '2019-04-09 23:06:59.125197', NULL), (298486374, 'MyString', 'MyString', '2019-04-09 23:06:59.125197', '2019-04-09 23:06:59.125197', NULL) +  (0.6ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) ALTER TABLE "tasks" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.2ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-09 16:06:59 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (9.7ms) +Completed 200 OK in 251ms (Views: 244.0ms | ActiveRecord: 0.3ms) +  (0.3ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.2ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.2ms) SAVEPOINT active_record_1 + Task Create (0.4ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at", "completion_date") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["name", "sample task"], ["description", "this is an example for a test"], ["created_at", "2019-04-09 23:06:59.466834"], ["updated_at", "2019-04-09 23:06:59.466834"], ["completion_date", "2019-04-14 23:06:59.464859"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) ROLLBACK +  (0.2ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------- +Task: test_0001_must be valid +----------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.2ms) BEGIN +  (0.4ms) ALTER TABLE "tasks" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN + Fixtures Load (0.4ms) DELETE FROM "tasks"; +INSERT INTO "tasks" ("id", "name", "description", "created_at", "updated_at", "completion_date") VALUES (980190962, 'MyString', 'MyString', '2019-04-09 23:19:52.470324', '2019-04-09 23:19:52.470324', NULL), (298486374, 'MyString', 'MyString', '2019-04-09 23:19:52.470324', '2019-04-09 23:19:52.470324', NULL) +  (0.6ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) ALTER TABLE "tasks" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.2ms) BEGIN +----------------------------- +Task: test_0001_must be valid +----------------------------- +  (0.4ms) ROLLBACK +  (0.2ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-09 16:19:52 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (2.2ms) +Completed 200 OK in 192ms (Views: 185.2ms | ActiveRecord: 0.3ms) +  (0.3ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +  (0.3ms) ROLLBACK +  (0.2ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (0.1ms) ROLLBACK diff --git a/test/controllers/tasks_controller_test.rb b/test/controllers/tasks_controller_test.rb index bbec7320e..971913898 100644 --- a/test/controllers/tasks_controller_test.rb +++ b/test/controllers/tasks_controller_test.rb @@ -28,6 +28,7 @@ # Unskip these tests for Wave 2 describe "show" do it "can get a valid task" do + skip # Act get task_path(task.id) From 605b90f72ddab1a77b55616a25d21d4cf4c49291 Mon Sep 17 00:00:00 2001 From: Kimberly-Fasbender Date: Wed, 10 Apr 2019 15:58:45 -0700 Subject: [PATCH 06/34] updated routes to include all RESTful routes and custom path names --- app/assets/stylesheets/application.css | 39 +- app/views/layouts/application.html.erb | 6 +- config/routes.rb | 12 +- log/development.log | 530 +++++++++++++++++++++++++ log/test.log | 288 ++++++++++++++ 5 files changed, 862 insertions(+), 13 deletions(-) diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 93f2138f6..c2f61b0ff 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -14,12 +14,35 @@ *= require_self */ - h1 { - color: tomato; - text-align: center; - } +body { + background: lightcyan; + display: grid; + grid-template-columns: 1fr 4fr; + grid-template-rows: 700px min-content; + margin: 0; +} + +nav { + background: lightgoldenrodyellow; + grid-column: 1 / 2; + grid-row: 1 / 2; +} + +main { + background: lightcyan; + grid-column: 2 / 3; + grid-row: 1 / 2; +} + +footer { + background: lightpink; + grid-column: 1 / 3; + grid-row: 2 / 3; +} + +h1 { + color: tomato; + text-align: left; +} + - body { - background: lightcyan; - margin: 5rem; - } diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index b5510cb02..0c1efc0e4 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -10,9 +10,9 @@ -
-

Task List

-
+
<%= yield %>
diff --git a/config/routes.rb b/config/routes.rb index fa5faee75..20d88fd7b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,6 +1,14 @@ Rails.application.routes.draw do - get "/tasks", to: "tasks#index" + get "/tasks", to: "tasks#index", as: "tasks" - get "/tasks/:id", to: "tasks#show" + get "/tasks/new", to: "tasks#new", as: "new_task" + post "/tasks", to: "tasks#create" + + get "/tasks/:id", to: "tasks#show", as: "task" + + get "/tasks/:id/edit", to: "tasks#edit", as: "edit_task" + patch "/tasks:id", to: "tasks#update" + + root to: "tasks#index" # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html end diff --git a/log/development.log b/log/development.log index 227e64823..accb9b614 100644 --- a/log/development.log +++ b/log/development.log @@ -595,3 +595,533 @@ Processing by TasksController#index as HTML Completed 200 OK in 29ms (Views: 20.5ms | ActiveRecord: 5.2ms) +Started GET "/tasks/" for ::1 at 2019-04-09 16:38:50 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.6ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.7ms) +Completed 200 OK in 26ms (Views: 23.1ms | ActiveRecord: 0.6ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 16:39:01 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.6ms) +Completed 200 OK in 29ms (Views: 26.2ms | ActiveRecord: 0.4ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 16:39:32 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.5ms) +Completed 200 OK in 31ms (Views: 28.5ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 16:40:11 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.2ms) +Completed 200 OK in 21ms (Views: 18.8ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 16:40:44 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.7ms) +Completed 200 OK in 28ms (Views: 25.7ms | ActiveRecord: 0.4ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 16:41:17 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.1ms) +Completed 200 OK in 31ms (Views: 28.3ms | ActiveRecord: 0.2ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 16:41:53 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.2ms) +Completed 200 OK in 30ms (Views: 27.2ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 16:42:22 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.2ms) +Completed 200 OK in 29ms (Views: 26.9ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 16:43:01 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.2ms) +Completed 200 OK in 28ms (Views: 25.1ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 16:43:27 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.7ms) +Completed 200 OK in 30ms (Views: 26.9ms | ActiveRecord: 0.4ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 16:43:57 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.3ms) +Completed 200 OK in 29ms (Views: 26.1ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 16:44:26 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.6ms) +Completed 200 OK in 30ms (Views: 27.7ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 16:44:33 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.4ms) +Completed 200 OK in 29ms (Views: 26.0ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 16:44:39 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.1ms) +Completed 200 OK in 29ms (Views: 26.2ms | ActiveRecord: 0.2ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 16:45:38 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.2ms) +Completed 200 OK in 35ms (Views: 32.5ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 16:46:02 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.1ms) +Completed 200 OK in 27ms (Views: 24.3ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 16:46:20 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.6ms) +Completed 200 OK in 31ms (Views: 28.3ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 16:47:27 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.2ms) +Completed 200 OK in 19ms (Views: 16.6ms | ActiveRecord: 0.4ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 16:48:00 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.5ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.8ms) +Completed 200 OK in 37ms (Views: 33.9ms | ActiveRecord: 0.5ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 16:49:10 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.5ms) +Completed 200 OK in 21ms (Views: 18.0ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 16:51:25 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.3ms) +Completed 200 OK in 30ms (Views: 27.2ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 16:59:00 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.6ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.8ms) +Completed 200 OK in 38ms (Views: 35.2ms | ActiveRecord: 0.6ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 17:00:54 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.5ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.9ms) +Completed 200 OK in 22ms (Views: 19.6ms | ActiveRecord: 0.5ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 17:03:40 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (2.0ms) +Completed 200 OK in 27ms (Views: 24.5ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 17:04:00 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.2ms) +Completed 200 OK in 26ms (Views: 23.5ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 17:04:22 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.1ms) +Completed 200 OK in 27ms (Views: 24.5ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 17:05:01 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.7ms) +Completed 200 OK in 26ms (Views: 23.5ms | ActiveRecord: 0.4ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 17:05:45 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.5ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.9ms) +Completed 200 OK in 29ms (Views: 26.5ms | ActiveRecord: 0.5ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 17:06:06 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.7ms) +Completed 200 OK in 42ms (Views: 38.3ms | ActiveRecord: 0.4ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 17:06:16 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.6ms) +Completed 200 OK in 27ms (Views: 24.7ms | ActiveRecord: 0.4ms) + + +Started GET "/tasks/1" for ::1 at 2019-04-09 17:06:17 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"1"} + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.6ms) +Completed 200 OK in 36ms (Views: 28.5ms | ActiveRecord: 1.0ms) + + +Started GET "/tasks/1" for ::1 at 2019-04-09 17:06:29 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"1"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.4ms) +Completed 200 OK in 31ms (Views: 27.9ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/1" for ::1 at 2019-04-09 17:06:37 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"1"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.3ms) +Completed 200 OK in 31ms (Views: 28.3ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/1" for ::1 at 2019-04-09 17:06:49 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"1"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.3ms) +Completed 200 OK in 25ms (Views: 22.5ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/1" for ::1 at 2019-04-09 17:08:42 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"1"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.4ms) +Completed 200 OK in 26ms (Views: 23.4ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/1" for ::1 at 2019-04-09 17:09:06 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"1"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.3ms) +Completed 200 OK in 31ms (Views: 27.5ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/1" for ::1 at 2019-04-09 17:09:08 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"1"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.3ms) +Completed 200 OK in 21ms (Views: 18.3ms | ActiveRecord: 0.2ms) + + +Started GET "/tasks/1" for ::1 at 2019-04-09 17:10:31 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"1"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.4ms) +Completed 200 OK in 40ms (Views: 35.1ms | ActiveRecord: 0.2ms) + + +Started GET "/tasks/1" for ::1 at 2019-04-09 17:10:37 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"1"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.6ms) +Completed 200 OK in 30ms (Views: 26.6ms | ActiveRecord: 0.2ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 18:35:48 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (1.3ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (3.2ms) +Completed 200 OK in 25ms (Views: 20.7ms | ActiveRecord: 1.3ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 18:35:51 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.5ms) +Completed 200 OK in 20ms (Views: 17.4ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 23:10:38 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.5ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.6ms) +Completed 200 OK in 48ms (Views: 44.5ms | ActiveRecord: 0.5ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 23:10:52 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.6ms) +Completed 200 OK in 28ms (Views: 24.8ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 23:10:59 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.7ms) +Completed 200 OK in 28ms (Views: 24.4ms | ActiveRecord: 0.4ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 23:11:16 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.3ms) +Completed 200 OK in 38ms (Views: 35.2ms | ActiveRecord: 0.2ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 23:11:23 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.3ms) +Completed 200 OK in 28ms (Views: 25.9ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 23:11:31 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.3ms) +Completed 200 OK in 31ms (Views: 28.5ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 23:11:49 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.8ms) +Completed 200 OK in 35ms (Views: 31.3ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 23:12:13 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.3ms) +Completed 200 OK in 24ms (Views: 20.9ms | ActiveRecord: 0.2ms) + + +Started GET "/tasks/1" for ::1 at 2019-04-09 23:12:17 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"1"} + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.4ms) +Completed 200 OK in 35ms (Views: 28.6ms | ActiveRecord: 0.8ms) + + +Started GET "/tasks/2" for ::1 at 2019-04-09 23:12:20 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"2"} + Task Load (0.5ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 2], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (1.2ms) +Completed 200 OK in 34ms (Views: 29.9ms | ActiveRecord: 0.5ms) + + +Started GET "/tasks/" for ::1 at 2019-04-09 23:34:00 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.6ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.6ms) +Completed 200 OK in 22ms (Views: 19.0ms | ActiveRecord: 0.6ms) + + +Started GET "/books" for ::1 at 2019-04-10 15:51:03 -0700 +  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC + ↳ /Users/kfasbender/.rvm/gems/ruby-2.5.3/gems/activerecord-5.2.3/lib/active_record/log_subscriber.rb:98 + +ActionController::RoutingError (No route matches [GET] "/books"): + +actionpack (5.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:65:in `call' +web-console (3.7.0) lib/web_console/middleware.rb:135:in `call_app' +web-console (3.7.0) lib/web_console/middleware.rb:30:in `block in call' +web-console (3.7.0) lib/web_console/middleware.rb:20:in `catch' +web-console (3.7.0) lib/web_console/middleware.rb:20:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call' +railties (5.2.3) lib/rails/rack/logger.rb:38:in `call_app' +railties (5.2.3) lib/rails/rack/logger.rb:26:in `block in call' +activesupport (5.2.3) lib/active_support/tagged_logging.rb:71:in `block in tagged' +activesupport (5.2.3) lib/active_support/tagged_logging.rb:28:in `tagged' +activesupport (5.2.3) lib/active_support/tagged_logging.rb:71:in `tagged' +railties (5.2.3) lib/rails/rack/logger.rb:26:in `call' +sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/remote_ip.rb:81:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/request_id.rb:27:in `call' +rack (2.0.7) lib/rack/method_override.rb:22:in `call' +rack (2.0.7) lib/rack/runtime.rb:22:in `call' +activesupport (5.2.3) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/executor.rb:14:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/static.rb:127:in `call' +rack (2.0.7) lib/rack/sendfile.rb:111:in `call' +railties (5.2.3) lib/rails/engine.rb:524:in `call' +puma (3.12.1) lib/puma/configuration.rb:227:in `call' +puma (3.12.1) lib/puma/server.rb:660:in `handle_request' +puma (3.12.1) lib/puma/server.rb:474:in `process_client' +puma (3.12.1) lib/puma/server.rb:334:in `block in run' +puma (3.12.1) lib/puma/thread_pool.rb:135:in `block in spawn_thread' +Started GET "/tasks" for ::1 at 2019-04-10 15:51:08 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (1.2ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (16.0ms) +Completed 200 OK in 292ms (Views: 279.0ms | ActiveRecord: 6.3ms) + + +Started GET "/tasks" for ::1 at 2019-04-10 15:57:04 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.6ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (10.0ms) +Completed 200 OK in 37ms (Views: 28.3ms | ActiveRecord: 5.1ms) + + diff --git a/log/test.log b/log/test.log index 4a7bfd635..51423895e 100644 --- a/log/test.log +++ b/log/test.log @@ -616,3 +616,291 @@ TasksController::edit: test_0002_will respond with redirect when attempting to e TasksController::create: test_0001_can create a new task --------------------------------------------------------  (0.1ms) ROLLBACK +  (1.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.1ms) BEGIN +  (0.3ms) ALTER TABLE "tasks" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN + Fixtures Load (0.6ms) DELETE FROM "tasks"; +INSERT INTO "tasks" ("id", "name", "description", "created_at", "updated_at", "completion_date") VALUES (980190962, 'MyString', 'MyString', '2019-04-10 06:34:08.239481', '2019-04-10 06:34:08.239481', NULL), (298486374, 'MyString', 'MyString', '2019-04-10 06:34:08.239481', '2019-04-10 06:34:08.239481', NULL) +  (0.3ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) ALTER TABLE "tasks" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------- +Task: test_0001_must be valid +----------------------------- +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-09 23:34:08 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (3.6ms) +Completed 200 OK in 306ms (Views: 297.6ms | ActiveRecord: 0.3ms) +  (0.3ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +  (0.1ms) ROLLBACK +  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.1ms) BEGIN +  (0.6ms) ALTER TABLE "tasks" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN + Fixtures Load (0.6ms) DELETE FROM "tasks"; +INSERT INTO "tasks" ("id", "name", "description", "created_at", "updated_at", "completion_date") VALUES (980190962, 'MyString', 'MyString', '2019-04-10 06:37:03.143733', '2019-04-10 06:37:03.143733', NULL), (298486374, 'MyString', 'MyString', '2019-04-10 06:37:03.143733', '2019-04-10 06:37:03.143733', NULL) +  (0.4ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) ALTER TABLE "tasks" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN +----------------------------- +Task: test_0001_must be valid +----------------------------- +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +  (0.2ms) ROLLBACK +  (0.2ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.2ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.2ms) ROLLBACK +  (0.2ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-09 23:37:03 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.5ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (5.3ms) +Completed 200 OK in 229ms (Views: 220.4ms | ActiveRecord: 0.5ms) +  (0.3ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.2ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.2ms) BEGIN +  (0.4ms) ALTER TABLE "tasks" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.2ms) BEGIN + Fixtures Load (0.7ms) DELETE FROM "tasks"; +INSERT INTO "tasks" ("id", "name", "description", "created_at", "updated_at", "completion_date") VALUES (980190962, 'MyString', 'MyString', '2019-04-10 06:37:52.415319', '2019-04-10 06:37:52.415319', NULL), (298486374, 'MyString', 'MyString', '2019-04-10 06:37:52.415319', '2019-04-10 06:37:52.415319', NULL) +  (0.5ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) ALTER TABLE "tasks" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-09 23:37:52 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (8.8ms) +Completed 200 OK in 232ms (Views: 226.0ms | ActiveRecord: 0.2ms) +  (0.3ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.2ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------- +Task: test_0001_must be valid +----------------------------- +  (0.1ms) ROLLBACK +  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (4.4ms) BEGIN +  (2.5ms) ALTER TABLE "tasks" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL +  (0.2ms) COMMIT +  (0.1ms) BEGIN + Fixtures Load (4.1ms) DELETE FROM "tasks"; +INSERT INTO "tasks" ("id", "name", "description", "created_at", "updated_at", "completion_date") VALUES (980190962, 'MyString', 'MyString', '2019-04-10 16:23:44.477620', '2019-04-10 16:23:44.477620', NULL), (298486374, 'MyString', 'MyString', '2019-04-10 16:23:44.477620', '2019-04-10 16:23:44.477620', NULL) +  (0.5ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) ALTER TABLE "tasks" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.7ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-10 09:23:44 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (12.1ms) +Completed 200 OK in 175ms (Views: 168.6ms | ActiveRecord: 0.3ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.2ms) BEGIN +----------------------------- +Task: test_0001_must be valid +----------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +  (0.1ms) ROLLBACK From b45ac5223b38ad94dc1bb334d6663b659677ab44 Mon Sep 17 00:00:00 2001 From: Kimberly-Fasbender Date: Wed, 10 Apr 2019 16:06:17 -0700 Subject: [PATCH 07/34] added the new action to the Task controller --- app/controllers/tasks_controller.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/controllers/tasks_controller.rb b/app/controllers/tasks_controller.rb index 075e90313..b80a003a1 100644 --- a/app/controllers/tasks_controller.rb +++ b/app/controllers/tasks_controller.rb @@ -9,4 +9,8 @@ def show head :not_found if @task.nil? end + + def new + @task = Task.new + end end From 35f25440255177cbe8109dd3e73d723410b1a3c7 Mon Sep 17 00:00:00 2001 From: Kimberly-Fasbender Date: Wed, 10 Apr 2019 16:19:03 -0700 Subject: [PATCH 08/34] created new.html.erb file and added a form to it --- app/views/layouts/application.html.erb | 2 +- app/views/tasks/index.html.erb | 2 + app/views/tasks/new.html.erb | 15 ++ log/development.log | 120 +++++++++++++++ log/test.log | 171 ++++++++++++++++++++++ test/controllers/tasks_controller_test.rb | 2 - 6 files changed, 309 insertions(+), 3 deletions(-) create mode 100644 app/views/tasks/new.html.erb diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 0c1efc0e4..95293351e 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -11,7 +11,7 @@
<%= yield %> diff --git a/app/views/tasks/index.html.erb b/app/views/tasks/index.html.erb index 0ef016519..2672fc526 100644 --- a/app/views/tasks/index.html.erb +++ b/app/views/tasks/index.html.erb @@ -8,3 +8,5 @@ <% end %> + +<%= link_to "Add Task", new_task_path, class: "link" %> diff --git a/app/views/tasks/new.html.erb b/app/views/tasks/new.html.erb new file mode 100644 index 000000000..8027fe815 --- /dev/null +++ b/app/views/tasks/new.html.erb @@ -0,0 +1,15 @@ +

Add A New Task

+ +<%= form_with model: @task, class: "create_task" do |f| %> +

Please add a new task to your list by filling out the following form:

+ + <%= f.label :name %> + <%= f.text_field :name %> + + <%= f.label :description %> + <%= f.text_field :description %> + + <%= f.submit "Add Task", class: "task_button" %> +<% end %> + +<%= link_to "Back to All Tasks", tasks_path %> diff --git a/log/development.log b/log/development.log index accb9b614..f5fdd168d 100644 --- a/log/development.log +++ b/log/development.log @@ -1125,3 +1125,123 @@ Processing by TasksController#index as HTML Completed 200 OK in 37ms (Views: 28.3ms | ActiveRecord: 5.1ms) +Started GET "/tasks" for ::1 at 2019-04-10 16:03:25 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.6ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (10.6ms) +Completed 200 OK in 31ms (Views: 21.6ms | ActiveRecord: 5.4ms) + + +Started GET "/tasks/new" for ::1 at 2019-04-10 16:03:32 -0700 +Processing by TasksController#new as HTML +Completed 500 Internal Server Error in 4ms (ActiveRecord: 0.0ms) + + + +NameError - uninitialized constant TasksController::Book: + app/controllers/tasks_controller.rb:14:in `new' + +Started POST "/__better_errors/2c71090b7bc423bb/variables" for ::1 at 2019-04-10 16:03:33 -0700 +Started GET "/tasks/new" for ::1 at 2019-04-10 16:03:45 -0700 +Processing by TasksController#new as HTML + Rendering tasks/new.html.erb within layouts/application + Rendered tasks/new.html.erb within layouts/application (0.4ms) +Completed 200 OK in 33ms (Views: 17.5ms | ActiveRecord: 5.4ms) + + +Started GET "/tasks/new" for ::1 at 2019-04-10 16:04:45 -0700 +Processing by TasksController#new as HTML + Rendering tasks/new.html.erb within layouts/application + Rendered tasks/new.html.erb within layouts/application (0.3ms) +Completed 200 OK in 30ms (Views: 26.9ms | ActiveRecord: 0.0ms) + + +Started GET "/tasks/new" for ::1 at 2019-04-10 16:07:22 -0700 +Processing by TasksController#new as HTML + Rendering tasks/new.html.erb within layouts/application + Rendered tasks/new.html.erb within layouts/application (1.0ms) +Completed 200 OK in 33ms (Views: 19.6ms | ActiveRecord: 2.6ms) + + +Started GET "/tasks" for ::1 at 2019-04-10 16:13:57 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.6ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (2.3ms) +Completed 200 OK in 32ms (Views: 28.4ms | ActiveRecord: 0.6ms) + + +Started GET "/" for ::1 at 2019-04-10 16:14:00 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.8ms) +Completed 200 OK in 46ms (Views: 42.7ms | ActiveRecord: 0.3ms) + + +Started GET "/" for ::1 at 2019-04-10 16:14:22 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.5ms) +Completed 200 OK in 25ms (Views: 22.2ms | ActiveRecord: 0.3ms) + + +Started GET "/" for ::1 at 2019-04-10 16:14:47 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.6ms) +Completed 200 OK in 25ms (Views: 22.3ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/new" for ::1 at 2019-04-10 16:14:50 -0700 +Processing by TasksController#new as HTML + Rendering tasks/new.html.erb within layouts/application + Rendered tasks/new.html.erb within layouts/application (2.2ms) +Completed 200 OK in 37ms (Views: 32.8ms | ActiveRecord: 0.0ms) + + +Started GET "/tasks/new" for ::1 at 2019-04-10 16:17:11 -0700 +Processing by TasksController#new as HTML + Rendering tasks/new.html.erb within layouts/application + Rendered tasks/new.html.erb within layouts/application (26.7ms) +Completed 200 OK in 50ms (Views: 47.9ms | ActiveRecord: 0.0ms) + + +Started GET "/tasks/new" for ::1 at 2019-04-10 16:17:55 -0700 +Processing by TasksController#new as HTML + Rendering tasks/new.html.erb within layouts/application + Rendered tasks/new.html.erb within layouts/application (2.4ms) +Completed 200 OK in 37ms (Views: 33.1ms | ActiveRecord: 0.0ms) + + +Started GET "/tasks" for ::1 at 2019-04-10 16:17:57 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.6ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (3.2ms) +Completed 200 OK in 43ms (Views: 38.5ms | ActiveRecord: 0.6ms) + + +Started GET "/tasks/new" for ::1 at 2019-04-10 16:17:58 -0700 +Processing by TasksController#new as HTML + Rendering tasks/new.html.erb within layouts/application + Rendered tasks/new.html.erb within layouts/application (3.2ms) +Completed 200 OK in 39ms (Views: 35.6ms | ActiveRecord: 0.0ms) + + +Started GET "/tasks/new" for ::1 at 2019-04-10 16:18:09 -0700 +Processing by TasksController#new as HTML + Rendering tasks/new.html.erb within layouts/application + Rendered tasks/new.html.erb within layouts/application (1.6ms) +Completed 200 OK in 25ms (Views: 22.1ms | ActiveRecord: 0.0ms) + + diff --git a/log/test.log b/log/test.log index 51423895e..2e1a76d96 100644 --- a/log/test.log +++ b/log/test.log @@ -904,3 +904,174 @@ TasksController::show: test_0001_can get a valid task TasksController::new: test_0001_can get the new task page ---------------------------------------------------------  (0.1ms) ROLLBACK +  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.1ms) BEGIN +  (0.8ms) ALTER TABLE "tasks" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN + Fixtures Load (0.7ms) DELETE FROM "tasks"; +INSERT INTO "tasks" ("id", "name", "description", "created_at", "updated_at", "completion_date") VALUES (980190962, 'MyString', 'MyString', '2019-04-10 22:59:31.331545', '2019-04-10 22:59:31.331545', NULL), (298486374, 'MyString', 'MyString', '2019-04-10 22:59:31.331545', '2019-04-10 22:59:31.331545', NULL) +  (0.4ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) ALTER TABLE "tasks" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.2ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +Started GET "/" for 127.0.0.1 at 2019-04-10 15:59:31 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (9.6ms) +Completed 200 OK in 156ms (Views: 149.6ms | ActiveRecord: 0.4ms) +  (0.2ms) ROLLBACK +  (0.2ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-10 15:59:31 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (0.7ms) +Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.3ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------- +Task: test_0001_must be valid +----------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.4ms) BEGIN +  (0.4ms) ALTER TABLE "tasks" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN + Fixtures Load (0.4ms) DELETE FROM "tasks"; +INSERT INTO "tasks" ("id", "name", "description", "created_at", "updated_at", "completion_date") VALUES (980190962, 'MyString', 'MyString', '2019-04-10 22:59:53.370855', '2019-04-10 22:59:53.370855', NULL), (298486374, 'MyString', 'MyString', '2019-04-10 22:59:53.370855', '2019-04-10 22:59:53.370855', NULL) +  (0.6ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) ALTER TABLE "tasks" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.5ms) BEGIN +----------------------------- +Task: test_0001_must be valid +----------------------------- +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.1ms) SAVEPOINT active_record_1 + Task Create (0.2ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at", "completion_date") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["name", "sample task"], ["description", "this is an example for a test"], ["created_at", "2019-04-10 22:59:53.399081"], ["updated_at", "2019-04-10 22:59:53.399081"], ["completion_date", "2019-04-15 22:59:53.396381"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Started GET "/tasks/980190963" for 127.0.0.1 at 2019-04-10 15:59:53 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"980190963"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190963], ["LIMIT", 1]] + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.8ms) +Completed 200 OK in 196ms (Views: 186.1ms | ActiveRecord: 0.4ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +Started GET "/tasks/-1" for 127.0.0.1 at 2019-04-10 15:59:53 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"-1"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] +Completed 404 Not Found in 1ms (ActiveRecord: 0.2ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-10 15:59:53 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (1.3ms) +Completed 200 OK in 7ms (Views: 2.1ms | ActiveRecord: 0.3ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +Started GET "/" for 127.0.0.1 at 2019-04-10 15:59:53 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (0.9ms) +Completed 200 OK in 3ms (Views: 1.9ms | ActiveRecord: 0.3ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.2ms) ROLLBACK +  (0.2ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +  (0.2ms) ROLLBACK +  (0.2ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (0.2ms) ROLLBACK diff --git a/test/controllers/tasks_controller_test.rb b/test/controllers/tasks_controller_test.rb index 971913898..2f63bc087 100644 --- a/test/controllers/tasks_controller_test.rb +++ b/test/controllers/tasks_controller_test.rb @@ -28,7 +28,6 @@ # Unskip these tests for Wave 2 describe "show" do it "can get a valid task" do - skip # Act get task_path(task.id) @@ -37,7 +36,6 @@ end it "will redirect for an invalid task" do - skip # Act get task_path(-1) From 22de300091413936c203e404469be7e4d2e2ba43 Mon Sep 17 00:00:00 2001 From: Kimberly-Fasbender Date: Wed, 10 Apr 2019 16:34:11 -0700 Subject: [PATCH 09/34] added create action to the Tasks controller --- app/controllers/tasks_controller.rb | 13 ++++ app/views/tasks/new.html.erb | 1 - log/development.log | 93 +++++++++++++++++++++++++++++ 3 files changed, 106 insertions(+), 1 deletion(-) diff --git a/app/controllers/tasks_controller.rb b/app/controllers/tasks_controller.rb index b80a003a1..d8339706d 100644 --- a/app/controllers/tasks_controller.rb +++ b/app/controllers/tasks_controller.rb @@ -13,4 +13,17 @@ def show def new @task = Task.new end + + def create + task = Task.new( + name: params[:task][:name], + description: params[:task][:description], + ) + + if task.save + redirect_to tasks_path + else + head :bad_request + end + end end diff --git a/app/views/tasks/new.html.erb b/app/views/tasks/new.html.erb index 8027fe815..c63ddb9ad 100644 --- a/app/views/tasks/new.html.erb +++ b/app/views/tasks/new.html.erb @@ -5,7 +5,6 @@ <%= f.label :name %> <%= f.text_field :name %> - <%= f.label :description %> <%= f.text_field :description %> diff --git a/log/development.log b/log/development.log index f5fdd168d..d5de94a51 100644 --- a/log/development.log +++ b/log/development.log @@ -1245,3 +1245,96 @@ Processing by TasksController#new as HTML Completed 200 OK in 25ms (Views: 22.1ms | ActiveRecord: 0.0ms) +Started GET "/tasks/new" for ::1 at 2019-04-10 16:19:19 -0700 +Processing by TasksController#new as HTML + Rendering tasks/new.html.erb within layouts/application + Rendered tasks/new.html.erb within layouts/application (1.5ms) +Completed 200 OK in 26ms (Views: 23.7ms | ActiveRecord: 0.0ms) + + +Started POST "/tasks" for ::1 at 2019-04-10 16:19:54 -0700 + +AbstractController::ActionNotFound - The action 'create' could not be found for TasksController: + +Started POST "/__better_errors/4c4f5c73105f496f/variables" for ::1 at 2019-04-10 16:19:54 -0700 +Started GET "/tasks" for ::1 at 2019-04-10 16:20:08 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.5ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (2.0ms) +Completed 200 OK in 24ms (Views: 21.1ms | ActiveRecord: 0.5ms) + + +Started GET "/tasks/new" for ::1 at 2019-04-10 16:20:09 -0700 +Processing by TasksController#new as HTML + Rendering tasks/new.html.erb within layouts/application + Rendered tasks/new.html.erb within layouts/application (4.0ms) +Completed 200 OK in 36ms (Views: 33.0ms | ActiveRecord: 0.0ms) + + +Started GET "/tasks/new" for ::1 at 2019-04-10 16:31:07 -0700 +Processing by TasksController#new as HTML + Rendering tasks/new.html.erb within layouts/application + Rendered tasks/new.html.erb within layouts/application (1.9ms) +Completed 200 OK in 49ms (Views: 29.5ms | ActiveRecord: 9.1ms) + + + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" +Started POST "/tasks" for ::1 at 2019-04-10 16:31:41 -0700 +Processing by TasksController#create as HTML + Parameters: {"utf8"=>"✓", "authenticity_token"=>"uHE0UyFRKfJ7EmWKqcK3WHjLQ4HHbHHZQkSrRGXezRZuNSbvUzfVxrAT/k1IbqiYisS/4hL0d7sMfO+eMFWIkg==", "task"=>{"name"=>"Sleep", "description"=>"For like 30 hours straight yo!"}, "commit"=>"Add Task"} +  (0.2ms) BEGIN + ↳ app/controllers/tasks_controller.rb:23 + Task Create (1.6ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Sleep"], ["description", "For like 30 hours straight yo!"], ["created_at", "2019-04-10 23:31:41.160009"], ["updated_at", "2019-04-10 23:31:41.160009"]] + ↳ app/controllers/tasks_controller.rb:23 +  (0.5ms) COMMIT + ↳ app/controllers/tasks_controller.rb:23 +Completed 500 Internal Server Error in 7ms (ActiveRecord: 2.3ms) + + + +ActionController::UrlGenerationError - No route matches {:action=>"show", :controller=>"tasks"}, missing required keys: [:id]: + app/controllers/tasks_controller.rb:24:in `create' + +Started POST "/__better_errors/250ed404889a7fd8/variables" for ::1 at 2019-04-10 16:31:41 -0700 + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" +Started GET "/tasks" for ::1 at 2019-04-10 16:32:42 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (8.1ms) +Completed 200 OK in 29ms (Views: 22.6ms | ActiveRecord: 2.9ms) + + +Started GET "/tasks/new" for ::1 at 2019-04-10 16:32:43 -0700 +Processing by TasksController#new as HTML + Rendering tasks/new.html.erb within layouts/application + Rendered tasks/new.html.erb within layouts/application (3.2ms) +Completed 200 OK in 36ms (Views: 33.2ms | ActiveRecord: 0.0ms) + + +Started POST "/tasks" for ::1 at 2019-04-10 16:33:03 -0700 +Processing by TasksController#create as HTML + Parameters: {"utf8"=>"✓", "authenticity_token"=>"C1WFTxZU4aGWDv4S/dLkWAY19h1tcNUycm0X+DqRorHhKCM7Osiwx5QOn67W9feDtTYTsbclnephvQ2fKH3N/A==", "task"=>{"name"=>"Drink A Beer", "description"=>"You deserve one, you little champion!"}, "commit"=>"Add Task"} +  (0.2ms) BEGIN + ↳ app/controllers/tasks_controller.rb:23 + Task Create (0.7ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Drink A Beer"], ["description", "You deserve one, you little champion!"], ["created_at", "2019-04-10 23:33:03.714385"], ["updated_at", "2019-04-10 23:33:03.714385"]] + ↳ app/controllers/tasks_controller.rb:23 +  (0.4ms) COMMIT + ↳ app/controllers/tasks_controller.rb:23 +Redirected to http://localhost:3000/tasks +Completed 302 Found in 5ms (ActiveRecord: 1.3ms) + + +Started GET "/tasks" for ::1 at 2019-04-10 16:33:03 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.5ms) +Completed 200 OK in 24ms (Views: 20.9ms | ActiveRecord: 0.3ms) + + + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" From 9197eb8f38097fb4673b31c53b44e8c3661f30c8 Mon Sep 17 00:00:00 2001 From: Kimberly-Fasbender Date: Wed, 10 Apr 2019 16:56:09 -0700 Subject: [PATCH 10/34] made updates to Tasks#create and created migration to add completed column to Tasks in order to pass test --- app/controllers/tasks_controller.rb | 2 +- .../20190410234636_add_completed_to_tasks.rb | 5 + db/schema.rb | 3 +- log/development.log | 86 ++ log/test.log | 951 ++++++++++++++++++ test/controllers/tasks_controller_test.rb | 14 +- 6 files changed, 1052 insertions(+), 9 deletions(-) create mode 100644 db/migrate/20190410234636_add_completed_to_tasks.rb diff --git a/app/controllers/tasks_controller.rb b/app/controllers/tasks_controller.rb index d8339706d..dc7e4071f 100644 --- a/app/controllers/tasks_controller.rb +++ b/app/controllers/tasks_controller.rb @@ -21,7 +21,7 @@ def create ) if task.save - redirect_to tasks_path + redirect_to task_path(task.id) else head :bad_request end diff --git a/db/migrate/20190410234636_add_completed_to_tasks.rb b/db/migrate/20190410234636_add_completed_to_tasks.rb new file mode 100644 index 000000000..e6206bcff --- /dev/null +++ b/db/migrate/20190410234636_add_completed_to_tasks.rb @@ -0,0 +1,5 @@ +class AddCompletedToTasks < ActiveRecord::Migration[5.2] + def change + add_column :tasks, :completed, :boolean, :default => false + end +end diff --git a/db/schema.rb b/db/schema.rb index 039afb90b..d1ed2f888 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2019_04_09_221101) do +ActiveRecord::Schema.define(version: 2019_04_10_234636) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -21,6 +21,7 @@ t.datetime "created_at", null: false t.datetime "updated_at", null: false t.datetime "completion_date" + t.boolean "completed", default: false end end diff --git a/log/development.log b/log/development.log index d5de94a51..1ab95e3e1 100644 --- a/log/development.log +++ b/log/development.log @@ -1338,3 +1338,89 @@ Completed 200 OK in 24ms (Views: 20.9ms | ActiveRecord: 0.3ms) Task Load (0.4ms) SELECT "tasks".* FROM "tasks" +Started GET "/tasks/1" for ::1 at 2019-04-10 16:40:09 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"1"} + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.5ms) +Completed 200 OK in 35ms (Views: 19.7ms | ActiveRecord: 0.6ms) + + +Started GET "/tasks/2" for ::1 at 2019-04-10 16:40:14 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"2"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 2], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.4ms) +Completed 200 OK in 24ms (Views: 20.7ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/3" for ::1 at 2019-04-10 16:40:16 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"3"} + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 3], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.4ms) +Completed 200 OK in 34ms (Views: 30.8ms | ActiveRecord: 0.4ms) + + +Started GET "/tasks/3" for ::1 at 2019-04-10 16:40:21 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"3"} + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 3], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.5ms) +Completed 200 OK in 25ms (Views: 21.2ms | ActiveRecord: 0.4ms) + + +Started GET "/tasks/4" for ::1 at 2019-04-10 16:40:23 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"4"} + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 4], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.3ms) +Completed 200 OK in 27ms (Views: 23.2ms | ActiveRecord: 0.4ms) + + +Started GET "/tasks/5" for ::1 at 2019-04-10 16:40:25 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"5"} + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 5], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 +Completed 404 Not Found in 2ms (ActiveRecord: 0.4ms) + + +  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC + ↳ bin/rails:9 +  (0.2ms) SELECT pg_try_advisory_lock(4169262226251541860) + ↳ bin/rails:9 +  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC + ↳ bin/rails:9 +Migrating to AddCompletedToTasks (20190410234636) +  (0.2ms) BEGIN + ↳ bin/rails:9 +  (5.9ms) ALTER TABLE "tasks" ADD "completed" boolean DEFAULT FALSE + ↳ db/migrate/20190410234636_add_completed_to_tasks.rb:3 + ActiveRecord::SchemaMigration Create (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20190410234636"]] + ↳ bin/rails:9 +  (0.6ms) COMMIT + ↳ bin/rails:9 + ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]] + ↳ bin/rails:9 +  (0.2ms) BEGIN + ↳ bin/rails:9 +  (0.1ms) COMMIT + ↳ bin/rails:9 +  (0.3ms) SELECT pg_advisory_unlock(4169262226251541860) + ↳ bin/rails:9 +  (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC + ↳ bin/rails:9 +  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC + ↳ bin/rails:9 + Task Load (0.5ms) SELECT "tasks".* FROM "tasks" diff --git a/log/test.log b/log/test.log index 2e1a76d96..12d3b3530 100644 --- a/log/test.log +++ b/log/test.log @@ -1075,3 +1075,954 @@ TasksController::new: test_0001_can get the new task page TasksController::create: test_0001_can create a new task --------------------------------------------------------  (0.2ms) ROLLBACK +  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.2ms) BEGIN +  (0.3ms) ALTER TABLE "tasks" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN + Fixtures Load (0.5ms) DELETE FROM "tasks"; +INSERT INTO "tasks" ("id", "name", "description", "created_at", "updated_at", "completion_date") VALUES (980190962, 'MyString', 'MyString', '2019-04-10 23:34:52.880280', '2019-04-10 23:34:52.880280', NULL), (298486374, 'MyString', 'MyString', '2019-04-10 23:34:52.880280', '2019-04-10 23:34:52.880280', NULL) +  (0.4ms) COMMIT +  (0.1ms) BEGIN +  (0.2ms) ALTER TABLE "tasks" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.2ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.2ms) SAVEPOINT active_record_1 + Task Create (0.3ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at", "completion_date") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["name", "sample task"], ["description", "this is an example for a test"], ["created_at", "2019-04-10 23:34:52.907217"], ["updated_at", "2019-04-10 23:34:52.907217"], ["completion_date", "2019-04-15 23:34:52.897064"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Started GET "/tasks/980190963" for 127.0.0.1 at 2019-04-10 16:34:52 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"980190963"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190963], ["LIMIT", 1]] + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (1.4ms) +Completed 200 OK in 215ms (Views: 205.8ms | ActiveRecord: 0.4ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +Started GET "/tasks/-1" for 127.0.0.1 at 2019-04-10 16:34:53 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"-1"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] +Completed 404 Not Found in 1ms (ActiveRecord: 0.3ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------- +Task: test_0001_must be valid +----------------------------- +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +Started GET "/tasks/new" for 127.0.0.1 at 2019-04-10 16:34:53 -0700 +Processing by TasksController#new as HTML + Rendering tasks/new.html.erb within layouts/application + Rendered tasks/new.html.erb within layouts/application (12.7ms) +Completed 200 OK in 16ms (Views: 13.8ms | ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (1.4ms) SELECT COUNT(*) FROM "tasks" +Started POST "/tasks" for 127.0.0.1 at 2019-04-10 16:34:53 -0700 +Processing by TasksController#create as HTML + Parameters: {"task"=>{"name"=>"new task", "description"=>"new task description", "completion_date"=>nil}} +  (0.2ms) SAVEPOINT active_record_1 + Task Create (0.3ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "new task"], ["description", "new task description"], ["created_at", "2019-04-10 23:34:53.169543"], ["updated_at", "2019-04-10 23:34:53.169543"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://www.example.com/tasks +Completed 302 Found in 2ms (ActiveRecord: 0.6ms) +  (0.2ms) SELECT COUNT(*) FROM "tasks" + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."name" = $1 LIMIT $2 [["name", "new task"], ["LIMIT", 1]] +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.2ms) ROLLBACK +  (0.2ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-10 16:34:53 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (1.1ms) +Completed 200 OK in 4ms (Views: 1.9ms | ActiveRecord: 0.2ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +Started GET "/" for 127.0.0.1 at 2019-04-10 16:34:53 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (0.9ms) +Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.3ms) +  (0.2ms) ROLLBACK +  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.2ms) BEGIN +  (0.3ms) ALTER TABLE "tasks" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN + Fixtures Load (0.4ms) DELETE FROM "tasks"; +INSERT INTO "tasks" ("id", "name", "description", "created_at", "updated_at", "completion_date") VALUES (980190962, 'MyString', 'MyString', '2019-04-10 23:38:26.203922', '2019-04-10 23:38:26.203922', NULL), (298486374, 'MyString', 'MyString', '2019-04-10 23:38:26.203922', '2019-04-10 23:38:26.203922', NULL) +  (0.4ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) ALTER TABLE "tasks" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-10 16:38:26 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (9.2ms) +Completed 200 OK in 186ms (Views: 178.4ms | ActiveRecord: 0.3ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +Started GET "/" for 127.0.0.1 at 2019-04-10 16:38:26 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (0.7ms) +Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.3ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------- +Task: test_0001_must be valid +----------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.2ms) BEGIN +  (0.6ms) ALTER TABLE "tasks" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL +  (0.2ms) COMMIT +  (0.2ms) BEGIN + Fixtures Load (0.5ms) DELETE FROM "tasks"; +INSERT INTO "tasks" ("id", "name", "description", "created_at", "updated_at", "completion_date") VALUES (980190962, 'MyString', 'MyString', '2019-04-10 23:39:04.276865', '2019-04-10 23:39:04.276865', NULL), (298486374, 'MyString', 'MyString', '2019-04-10 23:39:04.276865', '2019-04-10 23:39:04.276865', NULL) +  (0.6ms) COMMIT +  (0.1ms) BEGIN +  (0.2ms) ALTER TABLE "tasks" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL +  (0.2ms) COMMIT +  (0.1ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.2ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-10 16:39:04 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (7.6ms) +Completed 200 OK in 197ms (Views: 190.3ms | ActiveRecord: 0.4ms) +  (0.2ms) ROLLBACK +  (0.2ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +Started GET "/" for 127.0.0.1 at 2019-04-10 16:39:04 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (0.8ms) +Completed 200 OK in 3ms (Views: 2.1ms | ActiveRecord: 0.2ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------- +Task: test_0001_must be valid +----------------------------- +  (0.2ms) ROLLBACK +  (0.2ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (0.5ms) SELECT COUNT(*) FROM "tasks" +Started POST "/tasks" for 127.0.0.1 at 2019-04-10 16:39:04 -0700 +Processing by TasksController#create as HTML + Parameters: {"task"=>{"name"=>"new task", "description"=>"new task description", "completed"=>"false"}} +  (0.2ms) SAVEPOINT active_record_1 + Task Create (0.3ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "new task"], ["description", "new task description"], ["created_at", "2019-04-10 23:39:04.516467"], ["updated_at", "2019-04-10 23:39:04.516467"]] +  (0.2ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://www.example.com/tasks +Completed 302 Found in 4ms (ActiveRecord: 0.7ms) +  (0.3ms) SELECT COUNT(*) FROM "tasks" + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."name" = $1 LIMIT $2 [["name", "new task"], ["LIMIT", 1]] +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +Started GET "/tasks/-1" for 127.0.0.1 at 2019-04-10 16:39:04 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"-1"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] +Completed 404 Not Found in 1ms (ActiveRecord: 0.2ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +Started GET "/tasks/new" for 127.0.0.1 at 2019-04-10 16:39:04 -0700 +Processing by TasksController#new as HTML + Rendering tasks/new.html.erb within layouts/application + Rendered tasks/new.html.erb within layouts/application (4.7ms) +Completed 200 OK in 7ms (Views: 5.6ms | ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.2ms) BEGIN +  (0.3ms) ALTER TABLE "tasks" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN + Fixtures Load (0.5ms) DELETE FROM "tasks"; +INSERT INTO "tasks" ("id", "name", "description", "created_at", "updated_at", "completion_date") VALUES (980190962, 'MyString', 'MyString', '2019-04-10 23:41:58.462749', '2019-04-10 23:41:58.462749', NULL), (298486374, 'MyString', 'MyString', '2019-04-10 23:41:58.462749', '2019-04-10 23:41:58.462749', NULL) +  (0.3ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) ALTER TABLE "tasks" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (0.3ms) SELECT COUNT(*) FROM "tasks" +Started POST "/tasks" for 127.0.0.1 at 2019-04-10 16:41:58 -0700 +Processing by TasksController#create as HTML + Parameters: {"task"=>{"name"=>"new task", "description"=>"new task description", "completed"=>"false"}} +  (0.2ms) SAVEPOINT active_record_1 + Task Create (0.4ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "new task"], ["description", "new task description"], ["created_at", "2019-04-10 23:41:58.498596"], ["updated_at", "2019-04-10 23:41:58.498596"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://www.example.com/tasks +Completed 302 Found in 15ms (ActiveRecord: 0.7ms) +  (0.3ms) SELECT COUNT(*) FROM "tasks" + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."name" = $1 LIMIT $2 [["name", "new task"], ["LIMIT", 1]] +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-10 16:41:58 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (1.9ms) +Completed 200 OK in 180ms (Views: 177.6ms | ActiveRecord: 0.3ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +Started GET "/" for 127.0.0.1 at 2019-04-10 16:41:58 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (0.7ms) +Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.3ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +Started GET "/tasks/-1" for 127.0.0.1 at 2019-04-10 16:41:58 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"-1"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] +Completed 404 Not Found in 1ms (ActiveRecord: 0.2ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +Started GET "/tasks/new" for 127.0.0.1 at 2019-04-10 16:41:58 -0700 +Processing by TasksController#new as HTML + Rendering tasks/new.html.erb within layouts/application + Rendered tasks/new.html.erb within layouts/application (4.4ms) +Completed 200 OK in 7ms (Views: 5.3ms | ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------- +Task: test_0001_must be valid +----------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +  (0.1ms) ROLLBACK +  (0.2ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.2ms) BEGIN +  (0.3ms) ALTER TABLE "tasks" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN + Fixtures Load (0.4ms) DELETE FROM "tasks"; +INSERT INTO "tasks" ("id", "name", "description", "created_at", "updated_at", "completion_date") VALUES (980190962, 'MyString', 'MyString', '2019-04-10 23:44:13.725945', '2019-04-10 23:44:13.725945', NULL), (298486374, 'MyString', 'MyString', '2019-04-10 23:44:13.725945', '2019-04-10 23:44:13.725945', NULL) +  (0.3ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) ALTER TABLE "tasks" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +Started GET "/tasks/new" for 127.0.0.1 at 2019-04-10 16:44:13 -0700 +Processing by TasksController#new as HTML + Rendering tasks/new.html.erb within layouts/application + Rendered tasks/new.html.erb within layouts/application (5.1ms) +Completed 200 OK in 198ms (Views: 186.4ms | ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------- +Task: test_0001_must be valid +----------------------------- +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +Started GET "/tasks/-1" for 127.0.0.1 at 2019-04-10 16:44:13 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"-1"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] +Redirected to http://www.example.com/tasks +Completed 302 Found in 3ms (ActiveRecord: 0.5ms) +  (0.5ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (0.3ms) SELECT COUNT(*) FROM "tasks" +Started POST "/tasks" for 127.0.0.1 at 2019-04-10 16:44:13 -0700 +Processing by TasksController#create as HTML + Parameters: {"task"=>{"name"=>"new task", "description"=>"new task description", "completed"=>"false"}} +  (0.2ms) SAVEPOINT active_record_1 + Task Create (0.4ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "new task"], ["description", "new task description"], ["created_at", "2019-04-10 23:44:13.969498"], ["updated_at", "2019-04-10 23:44:13.969498"]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://www.example.com/tasks +Completed 302 Found in 4ms (ActiveRecord: 1.2ms) +  (0.3ms) SELECT COUNT(*) FROM "tasks" + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."name" = $1 LIMIT $2 [["name", "new task"], ["LIMIT", 1]] +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-10 16:44:13 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (1.2ms) +Completed 200 OK in 4ms (Views: 2.1ms | ActiveRecord: 0.3ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +Started GET "/" for 127.0.0.1 at 2019-04-10 16:44:13 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (0.9ms) +Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.4ms) +  (0.2ms) ROLLBACK +  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (1.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]] +  (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.2ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]] +  (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.1ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]] +  (212.9ms) DROP DATABASE IF EXISTS "TaskList_test" +  (490.5ms) CREATE DATABASE "TaskList_test" ENCODING = 'unicode' + SQL (0.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql" +  (0.2ms) DROP TABLE IF EXISTS "tasks" CASCADE +  (6.3ms) CREATE TABLE "tasks" ("id" bigserial primary key, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "completion_date" timestamp, "completed" boolean DEFAULT FALSE) +  (2.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY) +  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES (20190410234636) +  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES +(20190409221101), +(20190409220629), +(20190409214340); + + +  (2.2ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) + ActiveRecord::InternalMetadata Load (0.3ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]] +  (0.1ms) BEGIN + ActiveRecord::InternalMetadata Create (0.3ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "test"], ["created_at", "2019-04-10 23:50:07.880994"], ["updated_at", "2019-04-10 23:50:07.880994"]] +  (0.3ms) COMMIT + ActiveRecord::InternalMetadata Load (0.3ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]] +  (0.2ms) BEGIN +  (0.1ms) COMMIT +  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.1ms) BEGIN +  (0.4ms) ALTER TABLE "tasks" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN + Fixtures Load (0.9ms) DELETE FROM "tasks"; +INSERT INTO "tasks" ("id", "name", "description", "created_at", "updated_at", "completion_date", "completed") VALUES (980190962, 'MyString', 'MyString', '2019-04-10 23:50:08.047272', '2019-04-10 23:50:08.047272', NULL, DEFAULT), (298486374, 'MyString', 'MyString', '2019-04-10 23:50:08.047272', '2019-04-10 23:50:08.047272', NULL, DEFAULT) +  (0.4ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) ALTER TABLE "tasks" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.2ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (0.3ms) SELECT COUNT(*) FROM "tasks" +Started POST "/tasks" for 127.0.0.1 at 2019-04-10 16:50:08 -0700 +Processing by TasksController#create as HTML + Parameters: {"task"=>{"name"=>"new task", "description"=>"new task description", "completed"=>"false"}} +  (0.2ms) SAVEPOINT active_record_1 + Task Create (0.3ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "new task"], ["description", "new task description"], ["created_at", "2019-04-10 23:50:08.086579"], ["updated_at", "2019-04-10 23:50:08.086579"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://www.example.com/tasks +Completed 302 Found in 14ms (ActiveRecord: 0.6ms) +  (0.2ms) SELECT COUNT(*) FROM "tasks" + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."name" = $1 LIMIT $2 [["name", "new task"], ["LIMIT", 1]] +  (0.1ms) ROLLBACK +  (0.2ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.1ms) SAVEPOINT active_record_1 + Task Create (0.2ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "sample task"], ["description", "this is an example for a test"], ["created_at", "2019-04-10 23:50:08.095857"], ["updated_at", "2019-04-10 23:50:08.095857"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Started GET "/tasks/980190964" for 127.0.0.1 at 2019-04-10 16:50:08 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"980190964"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190964], ["LIMIT", 1]] + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.6ms) +Completed 200 OK in 196ms (Views: 193.4ms | ActiveRecord: 0.2ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +Started GET "/tasks/-1" for 127.0.0.1 at 2019-04-10 16:50:08 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"-1"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] +Redirected to http://www.example.com/tasks +Completed 302 Found in 1ms (ActiveRecord: 0.3ms) +  (0.2ms) ROLLBACK +  (0.2ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +  (0.1ms) ROLLBACK +  (0.2ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-10 16:50:08 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (1.3ms) +Completed 200 OK in 4ms (Views: 2.0ms | ActiveRecord: 0.3ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +Started GET "/" for 127.0.0.1 at 2019-04-10 16:50:08 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (0.8ms) +Completed 200 OK in 3ms (Views: 1.7ms | ActiveRecord: 0.2ms) +  (0.2ms) ROLLBACK +  (0.2ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +Started GET "/tasks/new" for 127.0.0.1 at 2019-04-10 16:50:08 -0700 +Processing by TasksController#new as HTML + Rendering tasks/new.html.erb within layouts/application + Rendered tasks/new.html.erb within layouts/application (6.9ms) +Completed 200 OK in 10ms (Views: 8.1ms | ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------- +Task: test_0001_must be valid +----------------------------- +  (0.2ms) ROLLBACK +  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.1ms) BEGIN +  (0.3ms) ALTER TABLE "tasks" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN + Fixtures Load (0.4ms) DELETE FROM "tasks"; +INSERT INTO "tasks" ("id", "name", "description", "created_at", "updated_at", "completion_date", "completed") VALUES (980190962, 'MyString', 'MyString', '2019-04-10 23:52:28.380980', '2019-04-10 23:52:28.380980', NULL, DEFAULT), (298486374, 'MyString', 'MyString', '2019-04-10 23:52:28.380980', '2019-04-10 23:52:28.380980', NULL, DEFAULT) +  (0.6ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) ALTER TABLE "tasks" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.2ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (0.3ms) SELECT COUNT(*) FROM "tasks" +Started POST "/tasks" for 127.0.0.1 at 2019-04-10 16:52:28 -0700 +Processing by TasksController#create as HTML + Parameters: {"task"=>{"name"=>"new task", "description"=>"new task description", "completed"=>"false"}} +  (0.3ms) SAVEPOINT active_record_1 + Task Create (0.3ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "new task"], ["description", "new task description"], ["created_at", "2019-04-10 23:52:28.417451"], ["updated_at", "2019-04-10 23:52:28.417451"]] +  (0.2ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://www.example.com/tasks +Completed 302 Found in 14ms (ActiveRecord: 0.9ms) +  (0.2ms) SELECT COUNT(*) FROM "tasks" + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."name" = $1 LIMIT $2 [["name", "new task"], ["LIMIT", 1]] +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-10 16:52:28 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (1.6ms) +Completed 200 OK in 198ms (Views: 196.6ms | ActiveRecord: 0.2ms) +  (0.3ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +Started GET "/" for 127.0.0.1 at 2019-04-10 16:52:28 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (0.8ms) +Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.2ms) +  (0.2ms) ROLLBACK +  (0.2ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +Started GET "/tasks/new" for 127.0.0.1 at 2019-04-10 16:52:28 -0700 +Processing by TasksController#new as HTML + Rendering tasks/new.html.erb within layouts/application + Rendered tasks/new.html.erb within layouts/application (5.3ms) +Completed 200 OK in 9ms (Views: 6.2ms | ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.1ms) SAVEPOINT active_record_1 + Task Create (0.2ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "sample task"], ["description", "this is an example for a test"], ["created_at", "2019-04-10 23:52:28.647919"], ["updated_at", "2019-04-10 23:52:28.647919"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Started GET "/tasks/980190964" for 127.0.0.1 at 2019-04-10 16:52:28 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"980190964"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190964], ["LIMIT", 1]] + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.3ms) +Completed 200 OK in 4ms (Views: 1.6ms | ActiveRecord: 0.2ms) +  (0.3ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +Started GET "/tasks/-1" for 127.0.0.1 at 2019-04-10 16:52:28 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"-1"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] +Completed 404 Not Found in 1ms (ActiveRecord: 0.2ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------- +Task: test_0001_must be valid +----------------------------- +  (0.1ms) ROLLBACK +  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.2ms) BEGIN +  (0.5ms) ALTER TABLE "tasks" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL +  (0.4ms) COMMIT +  (0.6ms) BEGIN + Fixtures Load (1.0ms) DELETE FROM "tasks"; +INSERT INTO "tasks" ("id", "name", "description", "created_at", "updated_at", "completion_date", "completed") VALUES (980190962, 'MyString', 'MyString', '2019-04-10 23:53:36.025741', '2019-04-10 23:53:36.025741', NULL, DEFAULT), (298486374, 'MyString', 'MyString', '2019-04-10 23:53:36.025741', '2019-04-10 23:53:36.025741', NULL, DEFAULT) +  (0.7ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) ALTER TABLE "tasks" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +Started GET "/tasks/new" for 127.0.0.1 at 2019-04-10 16:53:36 -0700 +Processing by TasksController#new as HTML + Rendering tasks/new.html.erb within layouts/application + Rendered tasks/new.html.erb within layouts/application (7.2ms) +Completed 200 OK in 209ms (Views: 197.7ms | ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.2ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.6ms) ROLLBACK +  (0.2ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +  (0.1ms) ROLLBACK +  (0.2ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.1ms) SAVEPOINT active_record_1 + Task Create (0.3ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "sample task"], ["description", "this is an example for a test"], ["created_at", "2019-04-10 23:53:36.268841"], ["updated_at", "2019-04-10 23:53:36.268841"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Started GET "/tasks/980190963" for 127.0.0.1 at 2019-04-10 16:53:36 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"980190963"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190963], ["LIMIT", 1]] + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.3ms) +Completed 200 OK in 6ms (Views: 1.5ms | ActiveRecord: 0.4ms) +  (0.3ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +Started GET "/tasks/-1" for 127.0.0.1 at 2019-04-10 16:53:36 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"-1"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] +Completed 404 Not Found in 1ms (ActiveRecord: 0.2ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------- +Task: test_0001_must be valid +----------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-10 16:53:36 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (1.2ms) +Completed 200 OK in 4ms (Views: 2.0ms | ActiveRecord: 0.3ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +Started GET "/" for 127.0.0.1 at 2019-04-10 16:53:36 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.7ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (2.4ms) +Completed 200 OK in 6ms (Views: 4.4ms | ActiveRecord: 0.7ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (0.3ms) SELECT COUNT(*) FROM "tasks" +Started POST "/tasks" for 127.0.0.1 at 2019-04-10 16:53:36 -0700 +Processing by TasksController#create as HTML + Parameters: {"task"=>{"name"=>"new task", "description"=>"new task description", "completed"=>"false"}} +  (0.2ms) SAVEPOINT active_record_1 + Task Create (0.3ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "new task"], ["description", "new task description"], ["created_at", "2019-04-10 23:53:36.306730"], ["updated_at", "2019-04-10 23:53:36.306730"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://www.example.com/tasks +Completed 302 Found in 2ms (ActiveRecord: 0.6ms) +  (0.2ms) SELECT COUNT(*) FROM "tasks" + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."name" = $1 LIMIT $2 [["name", "new task"], ["LIMIT", 1]] +  (0.2ms) ROLLBACK +  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.2ms) BEGIN +  (0.3ms) ALTER TABLE "tasks" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN + Fixtures Load (0.5ms) DELETE FROM "tasks"; +INSERT INTO "tasks" ("id", "name", "description", "created_at", "updated_at", "completion_date", "completed") VALUES (980190962, 'MyString', 'MyString', '2019-04-10 23:54:33.847839', '2019-04-10 23:54:33.847839', NULL, DEFAULT), (298486374, 'MyString', 'MyString', '2019-04-10 23:54:33.847839', '2019-04-10 23:54:33.847839', NULL, DEFAULT) +  (0.7ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) ALTER TABLE "tasks" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +Started GET "/tasks/new" for 127.0.0.1 at 2019-04-10 16:54:33 -0700 +Processing by TasksController#new as HTML + Rendering tasks/new.html.erb within layouts/application + Rendered tasks/new.html.erb within layouts/application (6.5ms) +Completed 200 OK in 182ms (Views: 168.3ms | ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------- +Task: test_0001_must be valid +----------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.1ms) SAVEPOINT active_record_1 + Task Create (0.3ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "sample task"], ["description", "this is an example for a test"], ["created_at", "2019-04-10 23:54:34.057476"], ["updated_at", "2019-04-10 23:54:34.057476"]] +  (0.2ms) RELEASE SAVEPOINT active_record_1 +Started GET "/tasks/980190963" for 127.0.0.1 at 2019-04-10 16:54:34 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"980190963"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190963], ["LIMIT", 1]] + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.5ms) +Completed 200 OK in 7ms (Views: 2.2ms | ActiveRecord: 0.4ms) +  (0.3ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +Started GET "/tasks/-1" for 127.0.0.1 at 2019-04-10 16:54:34 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"-1"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] +Completed 404 Not Found in 1ms (ActiveRecord: 0.3ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +Started GET "/" for 127.0.0.1 at 2019-04-10 16:54:34 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (1.1ms) +Completed 200 OK in 5ms (Views: 2.0ms | ActiveRecord: 0.2ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-10 16:54:34 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (0.7ms) +Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.2ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.2ms) ROLLBACK +  (0.2ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (0.2ms) SELECT COUNT(*) FROM "tasks" +Started POST "/tasks" for 127.0.0.1 at 2019-04-10 16:54:34 -0700 +Processing by TasksController#create as HTML + Parameters: {"task"=>{"name"=>"new task", "description"=>"new task description", "completed"=>"false"}} +  (0.2ms) SAVEPOINT active_record_1 + Task Create (0.2ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "new task"], ["description", "new task description"], ["created_at", "2019-04-10 23:54:34.098445"], ["updated_at", "2019-04-10 23:54:34.098445"]] +  (0.2ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://www.example.com/tasks/980190964 +Completed 302 Found in 2ms (ActiveRecord: 0.6ms) +  (0.2ms) SELECT COUNT(*) FROM "tasks" + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."name" = $1 LIMIT $2 [["name", "new task"], ["LIMIT", 1]] +  (0.2ms) ROLLBACK diff --git a/test/controllers/tasks_controller_test.rb b/test/controllers/tasks_controller_test.rb index 2f63bc087..b40df3add 100644 --- a/test/controllers/tasks_controller_test.rb +++ b/test/controllers/tasks_controller_test.rb @@ -1,9 +1,11 @@ require "test_helper" describe TasksController do + # Note to students: Your Task model **may** be different and + # you may need to modify this. let (:task) { Task.create name: "sample task", description: "this is an example for a test", - completion_date: Time.now + 5.days + completed: false } # Tests for Wave 1 @@ -40,14 +42,12 @@ get task_path(-1) # Assert - must_respond_with :redirect - expect(flash[:error]).must_equal "Could not find task with id: -1" + must_respond_with :not_found end end describe "new" do it "can get the new task page" do - skip # Act get new_task_path @@ -59,14 +59,15 @@ describe "create" do it "can create a new task" do - skip # Arrange + # Note to students: Your Task model **may** be different and + # you may need to modify this. task_hash = { task: { name: "new task", description: "new task description", - completion_date: nil, + completed: false, }, } @@ -77,7 +78,6 @@ new_task = Task.find_by(name: task_hash[:task][:name]) expect(new_task.description).must_equal task_hash[:task][:description] - expect(new_task.due_date.to_time.to_i).must_equal task_hash[:task][:due_date].to_i expect(new_task.completed).must_equal task_hash[:task][:completed] must_respond_with :redirect From ec223c47eb8a042c4c515b4f0f14c7f1b0b63436 Mon Sep 17 00:00:00 2001 From: Kimberly-Fasbender Date: Wed, 10 Apr 2019 20:00:05 -0700 Subject: [PATCH 11/34] added tests for Tasks#edit --- app/views/tasks/show.html.erb | 3 + log/development.log | 117 ++++++++ log/test.log | 332 ++++++++++++++++++++++ test/controllers/tasks_controller_test.rb | 16 +- 4 files changed, 464 insertions(+), 4 deletions(-) diff --git a/app/views/tasks/show.html.erb b/app/views/tasks/show.html.erb index 11f7fc660..43f5032c9 100644 --- a/app/views/tasks/show.html.erb +++ b/app/views/tasks/show.html.erb @@ -5,3 +5,6 @@

<%= @task.description %>

+ +<%= link_to "Edit Task", edit_task_path %> +<%= link_to "Back to Task List", tasks_path %> diff --git a/log/development.log b/log/development.log index 1ab95e3e1..272f69a84 100644 --- a/log/development.log +++ b/log/development.log @@ -1424,3 +1424,120 @@ Migrating to AddCompletedToTasks (20190410234636)  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC ↳ bin/rails:9 Task Load (0.5ms) SELECT "tasks".* FROM "tasks" +Started GET "/tasks/" for ::1 at 2019-04-10 16:56:34 -0700 +  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC + ↳ /Users/kfasbender/.rvm/gems/ruby-2.5.3/gems/activerecord-5.2.3/lib/active_record/log_subscriber.rb:98 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.5ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (12.4ms) +Completed 200 OK in 34ms (Views: 25.1ms | ActiveRecord: 5.0ms) + + +Started GET "/tasks/1" for ::1 at 2019-04-10 16:58:02 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"1"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.8ms) +Completed 200 OK in 32ms (Views: 26.7ms | ActiveRecord: 0.6ms) + + +Started GET "/tasks" for ::1 at 2019-04-10 16:58:04 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (1.7ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (4.7ms) +Completed 200 OK in 35ms (Views: 28.9ms | ActiveRecord: 1.7ms) + + +Started GET "/tasks/new" for ::1 at 2019-04-10 19:27:04 -0700 +Processing by TasksController#new as HTML + Rendering tasks/new.html.erb within layouts/application + Rendered tasks/new.html.erb within layouts/application (2.0ms) +Completed 200 OK in 33ms (Views: 30.8ms | ActiveRecord: 0.0ms) + + +Started GET "/tasks" for ::1 at 2019-04-10 19:27:07 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (4.4ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (6.4ms) +Completed 200 OK in 39ms (Views: 31.3ms | ActiveRecord: 4.4ms) + + +Started GET "/tasks/30" for ::1 at 2019-04-10 19:27:49 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"30"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 30], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 +Completed 404 Not Found in 3ms (ActiveRecord: 0.4ms) + + +Started GET "/tasks/" for ::1 at 2019-04-10 19:27:59 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (2.0ms) +Completed 200 OK in 24ms (Views: 20.0ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/3" for ::1 at 2019-04-10 19:28:03 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"3"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 3], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.5ms) +Completed 200 OK in 22ms (Views: 18.7ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/3" for ::1 at 2019-04-10 19:31:38 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"3"} + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 3], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.6ms) +Completed 200 OK in 23ms (Views: 19.7ms | ActiveRecord: 0.4ms) + + +Started GET "/tasks/3/edit" for ::1 at 2019-04-10 19:31:39 -0700 + +AbstractController::ActionNotFound - The action 'edit' could not be found for TasksController: + +Started POST "/__better_errors/020409e69bbeaf64/variables" for ::1 at 2019-04-10 19:31:39 -0700 +Started GET "/tasks/3" for ::1 at 2019-04-10 19:41:29 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"3"} + Task Load (0.5ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 3], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.6ms) +Completed 200 OK in 26ms (Views: 21.3ms | ActiveRecord: 0.6ms) + + +Started GET "/tasks" for ::1 at 2019-04-10 19:41:35 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (1.9ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (4.3ms) +Completed 200 OK in 39ms (Views: 33.2ms | ActiveRecord: 1.9ms) + + +Started GET "/tasks/2" for ::1 at 2019-04-10 19:41:42 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"2"} + Task Load (0.7ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 2], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (2.0ms) +Completed 200 OK in 36ms (Views: 31.3ms | ActiveRecord: 0.7ms) + + diff --git a/log/test.log b/log/test.log index 12d3b3530..441891721 100644 --- a/log/test.log +++ b/log/test.log @@ -2026,3 +2026,335 @@ Completed 302 Found in 2ms (ActiveRecord: 0.6ms)  (0.2ms) SELECT COUNT(*) FROM "tasks" Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."name" = $1 LIMIT $2 [["name", "new task"], ["LIMIT", 1]]  (0.2ms) ROLLBACK +  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.1ms) BEGIN +  (0.2ms) ALTER TABLE "tasks" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL +  (0.2ms) COMMIT +  (0.1ms) BEGIN + Fixtures Load (0.4ms) DELETE FROM "tasks"; +INSERT INTO "tasks" ("id", "name", "description", "created_at", "updated_at", "completion_date", "completed") VALUES (980190962, 'MyString', 'MyString', '2019-04-11 02:26:50.309744', '2019-04-11 02:26:50.309744', NULL, DEFAULT), (298486374, 'MyString', 'MyString', '2019-04-11 02:26:50.309744', '2019-04-11 02:26:50.309744', NULL, DEFAULT) +  (0.4ms) COMMIT +  (0.2ms) BEGIN +  (0.1ms) ALTER TABLE "tasks" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.2ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.4ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-10 19:26:50 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (10.3ms) +Completed 200 OK in 210ms (Views: 203.4ms | ActiveRecord: 0.3ms) +  (0.3ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +Started GET "/" for 127.0.0.1 at 2019-04-10 19:26:50 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (0.8ms) +Completed 200 OK in 2ms (Views: 1.9ms | ActiveRecord: 0.2ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (0.3ms) SELECT COUNT(*) FROM "tasks" +Started POST "/tasks" for 127.0.0.1 at 2019-04-10 19:26:50 -0700 +Processing by TasksController#create as HTML + Parameters: {"task"=>{"name"=>"new task", "description"=>"new task description", "completed"=>"false"}} +  (0.2ms) SAVEPOINT active_record_1 + Task Create (0.2ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "new task"], ["description", "new task description"], ["created_at", "2019-04-11 02:26:50.563543"], ["updated_at", "2019-04-11 02:26:50.563543"]] +  (0.2ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://www.example.com/tasks/980190963 +Completed 302 Found in 3ms (ActiveRecord: 0.6ms) +  (0.4ms) SELECT COUNT(*) FROM "tasks" + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."name" = $1 LIMIT $2 [["name", "new task"], ["LIMIT", 1]] +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.1ms) SAVEPOINT active_record_1 + Task Create (0.2ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "sample task"], ["description", "this is an example for a test"], ["created_at", "2019-04-11 02:26:50.570469"], ["updated_at", "2019-04-11 02:26:50.570469"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Started GET "/tasks/980190964" for 127.0.0.1 at 2019-04-10 19:26:50 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"980190964"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190964], ["LIMIT", 1]] + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.4ms) +Completed 200 OK in 4ms (Views: 1.5ms | ActiveRecord: 0.2ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +Started GET "/tasks/-1" for 127.0.0.1 at 2019-04-10 19:26:50 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"-1"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] +Completed 404 Not Found in 1ms (ActiveRecord: 0.2ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------- +Task: test_0001_must be valid +----------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +Started GET "/tasks/new" for 127.0.0.1 at 2019-04-10 19:26:50 -0700 +Processing by TasksController#new as HTML + Rendering tasks/new.html.erb within layouts/application + Rendered tasks/new.html.erb within layouts/application (8.4ms) +Completed 200 OK in 11ms (Views: 9.4ms | ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.1ms) BEGIN +  (0.3ms) ALTER TABLE "tasks" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN + Fixtures Load (0.5ms) DELETE FROM "tasks"; +INSERT INTO "tasks" ("id", "name", "description", "created_at", "updated_at", "completion_date", "completed") VALUES (980190962, 'MyString', 'MyString', '2019-04-11 02:33:24.973654', '2019-04-11 02:33:24.973654', NULL, DEFAULT), (298486374, 'MyString', 'MyString', '2019-04-11 02:33:24.973654', '2019-04-11 02:33:24.973654', NULL, DEFAULT) +  (0.4ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) ALTER TABLE "tasks" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.3ms) BEGIN +----------------------------- +Task: test_0001_must be valid +----------------------------- +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.1ms) SAVEPOINT active_record_1 + Task Create (0.3ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "sample task"], ["description", "this is an example for a test"], ["created_at", "2019-04-11 02:33:24.997278"], ["updated_at", "2019-04-11 02:33:24.997278"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Started GET "/tasks/980190963" for 127.0.0.1 at 2019-04-10 19:33:25 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"980190963"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190963], ["LIMIT", 1]] + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (1.6ms) +Completed 200 OK in 223ms (Views: 211.9ms | ActiveRecord: 0.5ms) +  (0.3ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +Started GET "/tasks/-1" for 127.0.0.1 at 2019-04-10 19:33:25 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"-1"} + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] +Completed 404 Not Found in 1ms (ActiveRecord: 0.4ms) +  (0.2ms) ROLLBACK +  (0.2ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.2ms) ROLLBACK +  (0.9ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.6ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +Started GET "/" for 127.0.0.1 at 2019-04-10 19:33:25 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (1.2ms) +Completed 200 OK in 4ms (Views: 2.0ms | ActiveRecord: 0.3ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-10 19:33:25 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (0.8ms) +Completed 200 OK in 2ms (Views: 1.4ms | ActiveRecord: 0.2ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +Started GET "/tasks/new" for 127.0.0.1 at 2019-04-10 19:33:25 -0700 +Processing by TasksController#new as HTML + Rendering tasks/new.html.erb within layouts/application + Rendered tasks/new.html.erb within layouts/application (15.5ms) +Completed 200 OK in 20ms (Views: 17.2ms | ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.2ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (0.5ms) SELECT COUNT(*) FROM "tasks" +Started POST "/tasks" for 127.0.0.1 at 2019-04-10 19:33:25 -0700 +Processing by TasksController#create as HTML + Parameters: {"task"=>{"name"=>"new task", "description"=>"new task description", "completed"=>"false"}} +  (0.2ms) SAVEPOINT active_record_1 + Task Create (0.5ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "new task"], ["description", "new task description"], ["created_at", "2019-04-11 02:33:25.292855"], ["updated_at", "2019-04-11 02:33:25.292855"]] +  (0.4ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://www.example.com/tasks/980190964 +Completed 302 Found in 5ms (ActiveRecord: 1.2ms) +  (0.5ms) SELECT COUNT(*) FROM "tasks" + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."name" = $1 LIMIT $2 [["name", "new task"], ["LIMIT", 1]] +  (0.2ms) ROLLBACK +  (2.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.2ms) BEGIN +  (0.4ms) ALTER TABLE "tasks" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL +  (0.2ms) COMMIT +  (0.1ms) BEGIN + Fixtures Load (0.5ms) DELETE FROM "tasks"; +INSERT INTO "tasks" ("id", "name", "description", "created_at", "updated_at", "completion_date", "completed") VALUES (980190962, 'MyString', 'MyString', '2019-04-11 02:58:49.116955', '2019-04-11 02:58:49.116955', NULL, DEFAULT), (298486374, 'MyString', 'MyString', '2019-04-11 02:58:49.116955', '2019-04-11 02:58:49.116955', NULL, DEFAULT) +  (0.4ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) ALTER TABLE "tasks" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN +----------------------------- +Task: test_0001_must be valid +----------------------------- +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +Started GET "/tasks/new" for 127.0.0.1 at 2019-04-10 19:58:49 -0700 +Processing by TasksController#new as HTML + Rendering tasks/new.html.erb within layouts/application + Rendered tasks/new.html.erb within layouts/application (6.2ms) +Completed 200 OK in 183ms (Views: 176.1ms | ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (0.3ms) SELECT COUNT(*) FROM "tasks" +Started POST "/tasks" for 127.0.0.1 at 2019-04-10 19:58:49 -0700 +Processing by TasksController#create as HTML + Parameters: {"task"=>{"name"=>"new task", "description"=>"new task description", "completed"=>"false"}} +  (0.2ms) SAVEPOINT active_record_1 + Task Create (0.3ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "new task"], ["description", "new task description"], ["created_at", "2019-04-11 02:58:49.345985"], ["updated_at", "2019-04-11 02:58:49.345985"]] +  (0.2ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://www.example.com/tasks/980190963 +Completed 302 Found in 3ms (ActiveRecord: 0.7ms) +  (0.3ms) SELECT COUNT(*) FROM "tasks" + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."name" = $1 LIMIT $2 [["name", "new task"], ["LIMIT", 1]] +  (0.3ms) ROLLBACK +  (0.2ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.1ms) SAVEPOINT active_record_1 + Task Create (0.2ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "thing"], ["description", "so many things to do!"], ["created_at", "2019-04-11 02:58:49.354055"], ["updated_at", "2019-04-11 02:58:49.354055"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Started GET "/tasks/980190964/edit" for 127.0.0.1 at 2019-04-10 19:58:49 -0700 +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +Started GET "/tasks/-1/edit" for 127.0.0.1 at 2019-04-10 19:58:49 -0700 +  (0.2ms) ROLLBACK +  (0.2ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +Started GET "/" for 127.0.0.1 at 2019-04-10 19:58:49 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (1.2ms) +Completed 200 OK in 4ms (Views: 1.8ms | ActiveRecord: 0.2ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-10 19:58:49 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (0.6ms) +Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.2ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +Started GET "/tasks/-1" for 127.0.0.1 at 2019-04-10 19:58:49 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"-1"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] +Completed 404 Not Found in 1ms (ActiveRecord: 0.2ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.1ms) SAVEPOINT active_record_1 + Task Create (0.2ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "sample task"], ["description", "this is an example for a test"], ["created_at", "2019-04-11 02:58:49.416992"], ["updated_at", "2019-04-11 02:58:49.416992"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Started GET "/tasks/980190965" for 127.0.0.1 at 2019-04-10 19:58:49 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"980190965"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190965], ["LIMIT", 1]] + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.5ms) +Completed 200 OK in 3ms (Views: 1.4ms | ActiveRecord: 0.2ms) +  (0.1ms) ROLLBACK diff --git a/test/controllers/tasks_controller_test.rb b/test/controllers/tasks_controller_test.rb index b40df3add..bbb4281b5 100644 --- a/test/controllers/tasks_controller_test.rb +++ b/test/controllers/tasks_controller_test.rb @@ -88,13 +88,21 @@ # Unskip and complete these tests for Wave 3 describe "edit" do it "can get the edit page for an existing task" do - skip - # Your code here + name = "thing" + description = "so many things to do!" + + new_task = Task.create(name: name, description: description) + + get edit_task_path(new_task.id) + + must_respond_with :success end it "will respond with redirect when attempting to edit a nonexistant task" do - skip - # Your code here + get edit_task_path(-1) + + must_respond_with :not_found + # redirect to where? task list? show task? end end From 809551fba802fd41201948f0bbef64ce12bc0df6 Mon Sep 17 00:00:00 2001 From: Kimberly-Fasbender Date: Wed, 10 Apr 2019 22:00:28 -0700 Subject: [PATCH 12/34] added edit action to Tasks Controller, added edit view file, and passing all tests --- app/controllers/tasks_controller.rb | 10 +- app/views/tasks/edit.html.erb | 16 + app/views/tasks/show.html.erb | 2 +- log/development.log | 231 ++++++ log/test.log | 864 ++++++++++++++++++++++ test/controllers/tasks_controller_test.rb | 3 +- 6 files changed, 1122 insertions(+), 4 deletions(-) create mode 100644 app/views/tasks/edit.html.erb diff --git a/app/controllers/tasks_controller.rb b/app/controllers/tasks_controller.rb index dc7e4071f..d810760d3 100644 --- a/app/controllers/tasks_controller.rb +++ b/app/controllers/tasks_controller.rb @@ -4,7 +4,7 @@ def index end def show - task_id = params[:id].to_i + task_id = params[:id] @task = Task.find_by(id: task_id) head :not_found if @task.nil? @@ -26,4 +26,12 @@ def create head :bad_request end end + + def edit + task_id = params[:id] + # @book = Book.new(title: "Default Title") + @task = Task.find_by(id: task_id) + + head :not_found if @task.nil? + end end diff --git a/app/views/tasks/edit.html.erb b/app/views/tasks/edit.html.erb new file mode 100644 index 000000000..913c9a642 --- /dev/null +++ b/app/views/tasks/edit.html.erb @@ -0,0 +1,16 @@ +

Edit A Task

+ +<%= form_with model: @task, class: "edit_task" do |f| %> +

Please edit any task information by filling out the following form:

+ +<%# , :input_html => { :value => @task.name } %> + <%= f.label :name %> + <%= f.text_field :name%> + + <%= f.label :description %> + <%= f.text_field :description %> + + <%= f.submit "Add Task", class: "task_button" %> +<% end %> + +<%= link_to "Back to All Tasks", tasks_path %> diff --git a/app/views/tasks/show.html.erb b/app/views/tasks/show.html.erb index 43f5032c9..e701b4372 100644 --- a/app/views/tasks/show.html.erb +++ b/app/views/tasks/show.html.erb @@ -6,5 +6,5 @@ <%= @task.description %> -<%= link_to "Edit Task", edit_task_path %> +<%= link_to "Edit Task", edit_task_path(@task.id) %> <%= link_to "Back to Task List", tasks_path %> diff --git a/log/development.log b/log/development.log index 272f69a84..a19dadb54 100644 --- a/log/development.log +++ b/log/development.log @@ -1541,3 +1541,234 @@ Processing by TasksController#show as HTML Completed 200 OK in 36ms (Views: 31.3ms | ActiveRecord: 0.7ms) +Started GET "/" for ::1 at 2019-04-10 21:49:34 -0700 +  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC + ↳ /Users/kfasbender/.rvm/gems/ruby-2.5.3/gems/activerecord-5.2.3/lib/active_record/log_subscriber.rb:98 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.5ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (13.0ms) +Completed 200 OK in 244ms (Views: 219.2ms | ActiveRecord: 5.0ms) + + +Started GET "/tasks/4" for ::1 at 2019-04-10 21:49:37 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"4"} + Task Load (2.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 4], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.8ms) +Completed 200 OK in 31ms (Views: 23.1ms | ActiveRecord: 2.7ms) + + +Started GET "/tasks/4/edit" for ::1 at 2019-04-10 21:49:38 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"4"} + Task Load (3.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 4], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:33 + Rendering tasks/edit.html.erb within layouts/application + Rendered tasks/edit.html.erb within layouts/application (11.1ms) +Completed 200 OK in 48ms (Views: 40.1ms | ActiveRecord: 3.3ms) + + +Started GET "/tasks" for ::1 at 2019-04-10 21:50:09 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (2.0ms) +Completed 200 OK in 35ms (Views: 31.4ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/3" for ::1 at 2019-04-10 21:50:10 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"3"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 3], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (1.0ms) +Completed 200 OK in 29ms (Views: 24.9ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/3/edit" for ::1 at 2019-04-10 21:50:11 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"3"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 3], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:33 + Rendering tasks/edit.html.erb within layouts/application + Rendered tasks/edit.html.erb within layouts/application (3.1ms) +Completed 200 OK in 44ms (Views: 39.0ms | ActiveRecord: 0.3ms) + + +Started PATCH "/tasks/3" for ::1 at 2019-04-10 21:50:27 -0700 + +ActionController::RoutingError (No route matches [PATCH] "/tasks/3"): + +actionpack (5.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:65:in `call' +web-console (3.7.0) lib/web_console/middleware.rb:135:in `call_app' +web-console (3.7.0) lib/web_console/middleware.rb:30:in `block in call' +web-console (3.7.0) lib/web_console/middleware.rb:20:in `catch' +web-console (3.7.0) lib/web_console/middleware.rb:20:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call' +railties (5.2.3) lib/rails/rack/logger.rb:38:in `call_app' +railties (5.2.3) lib/rails/rack/logger.rb:26:in `block in call' +activesupport (5.2.3) lib/active_support/tagged_logging.rb:71:in `block in tagged' +activesupport (5.2.3) lib/active_support/tagged_logging.rb:28:in `tagged' +activesupport (5.2.3) lib/active_support/tagged_logging.rb:71:in `tagged' +railties (5.2.3) lib/rails/rack/logger.rb:26:in `call' +sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/remote_ip.rb:81:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/request_id.rb:27:in `call' +rack (2.0.7) lib/rack/method_override.rb:22:in `call' +rack (2.0.7) lib/rack/runtime.rb:22:in `call' +activesupport (5.2.3) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/executor.rb:14:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/static.rb:127:in `call' +rack (2.0.7) lib/rack/sendfile.rb:111:in `call' +railties (5.2.3) lib/rails/engine.rb:524:in `call' +puma (3.12.1) lib/puma/configuration.rb:227:in `call' +puma (3.12.1) lib/puma/server.rb:660:in `handle_request' +puma (3.12.1) lib/puma/server.rb:474:in `process_client' +puma (3.12.1) lib/puma/server.rb:334:in `block in run' +puma (3.12.1) lib/puma/thread_pool.rb:135:in `block in spawn_thread' +Started GET "/tasks" for ::1 at 2019-04-10 21:50:46 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.5ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (2.6ms) +Completed 200 OK in 31ms (Views: 27.6ms | ActiveRecord: 0.5ms) + + +Started GET "/tasks/2" for ::1 at 2019-04-10 21:50:47 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"2"} + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 2], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (1.2ms) +Completed 200 OK in 54ms (Views: 49.8ms | ActiveRecord: 0.4ms) + + +Started GET "/tasks/2/edit" for ::1 at 2019-04-10 21:50:48 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"2"} + Task Load (0.5ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 2], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:33 + Rendering tasks/edit.html.erb within layouts/application + Rendered tasks/edit.html.erb within layouts/application (6.5ms) +Completed 200 OK in 38ms (Views: 33.1ms | ActiveRecord: 0.5ms) + + +Started GET "/tasks/2/edit" for ::1 at 2019-04-10 21:51:14 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"2"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 2], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:33 + Rendering tasks/edit.html.erb within layouts/application + Rendered tasks/edit.html.erb within layouts/application (4.5ms) +Completed 500 Internal Server Error in 15ms (ActiveRecord: 0.3ms) + + + +ArgumentError - wrong number of arguments (given 0, expected 1..2): + app/views/tasks/edit.html.erb:8:in `block in _app_views_tasks_edit_html_erb___882312878099312187_70194845319180' + app/views/tasks/edit.html.erb:3:in `_app_views_tasks_edit_html_erb___882312878099312187_70194845319180' + +Started POST "/__better_errors/03d37ca331e7d759/variables" for ::1 at 2019-04-10 21:51:14 -0700 +Started GET "/tasks/2/edit" for ::1 at 2019-04-10 21:52:12 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"2"} + Task Load (0.5ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 2], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:33 + Rendering tasks/edit.html.erb within layouts/application + Rendered tasks/edit.html.erb within layouts/application (1.6ms) +Completed 200 OK in 26ms (Views: 21.9ms | ActiveRecord: 0.5ms) + + +Started GET "/tasks" for ::1 at 2019-04-10 21:52:14 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (1.9ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (5.0ms) +Completed 200 OK in 44ms (Views: 38.7ms | ActiveRecord: 1.9ms) + + +Started GET "/tasks/1" for ::1 at 2019-04-10 21:52:17 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"1"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.7ms) +Completed 200 OK in 42ms (Views: 38.7ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks" for ::1 at 2019-04-10 21:52:20 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (2.4ms) +Completed 200 OK in 51ms (Views: 48.3ms | ActiveRecord: 0.4ms) + + +Started GET "/tasks/new" for ::1 at 2019-04-10 21:52:22 -0700 +Processing by TasksController#new as HTML + Rendering tasks/new.html.erb within layouts/application + Rendered tasks/new.html.erb within layouts/application (3.3ms) +Completed 200 OK in 37ms (Views: 33.6ms | ActiveRecord: 0.0ms) + + +Started GET "/tasks" for ::1 at 2019-04-10 21:52:29 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (3.2ms) +Completed 200 OK in 49ms (Views: 44.5ms | ActiveRecord: 0.4ms) + + +Started GET "/tasks/1" for ::1 at 2019-04-10 21:58:18 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"1"} + Task Load (0.6ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.6ms) +Completed 200 OK in 45ms (Views: 19.6ms | ActiveRecord: 12.3ms) + + +Started GET "/tasks/1/edit" for ::1 at 2019-04-10 21:58:20 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"1"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:33 + Rendering tasks/edit.html.erb within layouts/application + Rendered tasks/edit.html.erb within layouts/application (2.6ms) +Completed 200 OK in 33ms (Views: 28.5ms | ActiveRecord: 0.2ms) + + +Started GET "/tasks/-1/edit" for ::1 at 2019-04-10 21:58:25 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"-1"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:33 +Completed 404 Not Found in 2ms (ActiveRecord: 0.3ms) + + + +ActiveRecord::RecordNotFound - Couldn't find Task with 'id'=-1: + app/controllers/tasks_controller.rb:33:in `edit' + +Started POST "/__better_errors/a3250cefeb7e596d/variables" for ::1 at 2019-04-10 21:58:25 -0700 +Started GET "/tasks/-1/edit" for ::1 at 2019-04-10 21:59:31 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"-1"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:33 +Completed 404 Not Found in 4ms (ActiveRecord: 1.2ms) + + diff --git a/log/test.log b/log/test.log index 441891721..99f577580 100644 --- a/log/test.log +++ b/log/test.log @@ -2358,3 +2358,867 @@ Processing by TasksController#show as HTML Rendered tasks/show.html.erb within layouts/application (0.5ms) Completed 200 OK in 3ms (Views: 1.4ms | ActiveRecord: 0.2ms)  (0.1ms) ROLLBACK +  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.2ms) BEGIN +  (0.3ms) ALTER TABLE "tasks" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN + Fixtures Load (0.5ms) DELETE FROM "tasks"; +INSERT INTO "tasks" ("id", "name", "description", "created_at", "updated_at", "completion_date", "completed") VALUES (980190962, 'MyString', 'MyString', '2019-04-11 04:43:50.138501', '2019-04-11 04:43:50.138501', NULL, DEFAULT), (298486374, 'MyString', 'MyString', '2019-04-11 04:43:50.138501', '2019-04-11 04:43:50.138501', NULL, DEFAULT) +  (0.4ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) ALTER TABLE "tasks" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.4ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-10 21:43:50 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (12.5ms) +Completed 200 OK in 214ms (Views: 207.9ms | ActiveRecord: 0.4ms) +  (0.3ms) ROLLBACK +  (0.2ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +Started GET "/" for 127.0.0.1 at 2019-04-10 21:43:50 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (1.2ms) +Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.3ms) +  (0.2ms) ROLLBACK +  (0.2ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +Started GET "/tasks/new" for 127.0.0.1 at 2019-04-10 21:43:50 -0700 +Processing by TasksController#new as HTML + Rendering tasks/new.html.erb within layouts/application + Rendered tasks/new.html.erb within layouts/application (11.7ms) +Completed 200 OK in 18ms (Views: 14.3ms | ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------- +Task: test_0001_must be valid +----------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.2ms) SAVEPOINT active_record_1 + Task Create (0.3ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "thing"], ["description", "so many things to do!"], ["created_at", "2019-04-11 04:43:50.410359"], ["updated_at", "2019-04-11 04:43:50.410359"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Started GET "/tasks/980190963/edit" for 127.0.0.1 at 2019-04-10 21:43:50 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"980190963"} +Completed 500 Internal Server Error in 2ms (ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +Started GET "/tasks/-1/edit" for 127.0.0.1 at 2019-04-10 21:43:50 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"-1"} +Completed 500 Internal Server Error in 1ms (ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.2ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.2ms) SAVEPOINT active_record_1 + Task Create (0.3ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "sample task"], ["description", "this is an example for a test"], ["created_at", "2019-04-11 04:43:50.424705"], ["updated_at", "2019-04-11 04:43:50.424705"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Started GET "/tasks/980190964" for 127.0.0.1 at 2019-04-10 21:43:50 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"980190964"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190964], ["LIMIT", 1]] + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.7ms) +Completed 200 OK in 7ms (Views: 1.8ms | ActiveRecord: 0.5ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +Started GET "/tasks/-1" for 127.0.0.1 at 2019-04-10 21:43:50 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"-1"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] +Completed 404 Not Found in 2ms (ActiveRecord: 0.2ms) +  (0.2ms) ROLLBACK +  (0.2ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (0.3ms) SELECT COUNT(*) FROM "tasks" +Started POST "/tasks" for 127.0.0.1 at 2019-04-10 21:43:50 -0700 +Processing by TasksController#create as HTML + Parameters: {"task"=>{"name"=>"new task", "description"=>"new task description", "completed"=>"false"}} +  (0.2ms) SAVEPOINT active_record_1 + Task Create (0.4ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "new task"], ["description", "new task description"], ["created_at", "2019-04-11 04:43:50.448810"], ["updated_at", "2019-04-11 04:43:50.448810"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://www.example.com/tasks/980190965 +Completed 302 Found in 3ms (ActiveRecord: 0.7ms) +  (0.4ms) SELECT COUNT(*) FROM "tasks" + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."name" = $1 LIMIT $2 [["name", "new task"], ["LIMIT", 1]] +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.2ms) ROLLBACK +  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.1ms) BEGIN +  (0.2ms) ALTER TABLE "tasks" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN + Fixtures Load (0.5ms) DELETE FROM "tasks"; +INSERT INTO "tasks" ("id", "name", "description", "created_at", "updated_at", "completion_date", "completed") VALUES (980190962, 'MyString', 'MyString', '2019-04-11 04:53:59.621092', '2019-04-11 04:53:59.621092', NULL, DEFAULT), (298486374, 'MyString', 'MyString', '2019-04-11 04:53:59.621092', '2019-04-11 04:53:59.621092', NULL, DEFAULT) +  (1.0ms) COMMIT +  (0.1ms) BEGIN +  (0.2ms) ALTER TABLE "tasks" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.2ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +Started GET "/tasks/new" for 127.0.0.1 at 2019-04-10 21:53:59 -0700 +Processing by TasksController#new as HTML + Rendering tasks/new.html.erb within layouts/application + Rendered tasks/new.html.erb within layouts/application (6.3ms) +Completed 200 OK in 185ms (Views: 171.0ms | ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +Started GET "/" for 127.0.0.1 at 2019-04-10 21:53:59 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (2.3ms) +Completed 200 OK in 7ms (Views: 3.2ms | ActiveRecord: 0.3ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-10 21:53:59 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (0.9ms) +Completed 200 OK in 3ms (Views: 2.7ms | ActiveRecord: 0.2ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------- +Task: test_0001_must be valid +----------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +Started GET "/tasks/-1/edit" for 127.0.0.1 at 2019-04-10 21:53:59 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"-1"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] +Completed 404 Not Found in 2ms (ActiveRecord: 0.3ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.1ms) SAVEPOINT active_record_1 + Task Create (0.3ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "thing"], ["description", "so many things to do!"], ["created_at", "2019-04-11 04:53:59.858447"], ["updated_at", "2019-04-11 04:53:59.858447"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Started GET "/tasks/980190963/edit" for 127.0.0.1 at 2019-04-10 21:53:59 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"980190963"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190963], ["LIMIT", 1]] + Rendering tasks/edit.html.erb within layouts/application + Rendered tasks/edit.html.erb within layouts/application (1.4ms) +Completed 200 OK in 6ms (Views: 3.8ms | ActiveRecord: 0.3ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.1ms) SAVEPOINT active_record_1 + Task Create (0.2ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "sample task"], ["description", "this is an example for a test"], ["created_at", "2019-04-11 04:53:59.870642"], ["updated_at", "2019-04-11 04:53:59.870642"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Started GET "/tasks/980190964" for 127.0.0.1 at 2019-04-10 21:53:59 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"980190964"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190964], ["LIMIT", 1]] + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.5ms) +Completed 200 OK in 4ms (Views: 1.5ms | ActiveRecord: 0.2ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +Started GET "/tasks/-1" for 127.0.0.1 at 2019-04-10 21:53:59 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"-1"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] +Completed 404 Not Found in 1ms (ActiveRecord: 0.3ms) +  (0.2ms) ROLLBACK +  (0.2ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (0.4ms) SELECT COUNT(*) FROM "tasks" +Started POST "/tasks" for 127.0.0.1 at 2019-04-10 21:53:59 -0700 +Processing by TasksController#create as HTML + Parameters: {"task"=>{"name"=>"new task", "description"=>"new task description", "completed"=>"false"}} +  (0.1ms) SAVEPOINT active_record_1 + Task Create (0.3ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "new task"], ["description", "new task description"], ["created_at", "2019-04-11 04:53:59.889543"], ["updated_at", "2019-04-11 04:53:59.889543"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://www.example.com/tasks/980190965 +Completed 302 Found in 3ms (ActiveRecord: 0.6ms) +  (0.3ms) SELECT COUNT(*) FROM "tasks" + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."name" = $1 LIMIT $2 [["name", "new task"], ["LIMIT", 1]] +  (0.1ms) ROLLBACK +  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.3ms) BEGIN +  (0.4ms) ALTER TABLE "tasks" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL +  (0.2ms) COMMIT +  (0.1ms) BEGIN + Fixtures Load (0.9ms) DELETE FROM "tasks"; +INSERT INTO "tasks" ("id", "name", "description", "created_at", "updated_at", "completion_date", "completed") VALUES (980190962, 'MyString', 'MyString', '2019-04-11 04:55:52.261130', '2019-04-11 04:55:52.261130', NULL, DEFAULT), (298486374, 'MyString', 'MyString', '2019-04-11 04:55:52.261130', '2019-04-11 04:55:52.261130', NULL, DEFAULT) +  (5.5ms) COMMIT +  (0.2ms) BEGIN +  (0.2ms) ALTER TABLE "tasks" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (0.3ms) SELECT COUNT(*) FROM "tasks" +Started POST "/tasks" for 127.0.0.1 at 2019-04-10 21:55:52 -0700 +Processing by TasksController#create as HTML + Parameters: {"task"=>{"name"=>"new task", "description"=>"new task description", "completed"=>"false"}} +  (0.2ms) SAVEPOINT active_record_1 + Task Create (0.3ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "new task"], ["description", "new task description"], ["created_at", "2019-04-11 04:55:52.307503"], ["updated_at", "2019-04-11 04:55:52.307503"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://www.example.com/tasks/980190963 +Completed 302 Found in 13ms (ActiveRecord: 0.6ms) +  (0.2ms) SELECT COUNT(*) FROM "tasks" + Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."name" = $1 LIMIT $2 [["name", "new task"], ["LIMIT", 1]] +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-10 21:55:52 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (1.6ms) +Completed 200 OK in 160ms (Views: 158.1ms | ActiveRecord: 0.3ms) +  (0.2ms) ROLLBACK +  (0.2ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +Started GET "/" for 127.0.0.1 at 2019-04-10 21:55:52 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (1.3ms) +Completed 200 OK in 3ms (Views: 2.4ms | ActiveRecord: 0.4ms) +  (0.7ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------- +Task: test_0001_must be valid +----------------------------- +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +Started GET "/tasks/new" for 127.0.0.1 at 2019-04-10 21:55:52 -0700 +Processing by TasksController#new as HTML + Rendering tasks/new.html.erb within layouts/application + Rendered tasks/new.html.erb within layouts/application (4.0ms) +Completed 200 OK in 7ms (Views: 5.1ms | ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.2ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.2ms) SAVEPOINT active_record_1 + Task Create (0.3ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "thing"], ["description", "so many things to do!"], ["created_at", "2019-04-11 04:55:52.500631"], ["updated_at", "2019-04-11 04:55:52.500631"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Started GET "/tasks/980190964/edit" for 127.0.0.1 at 2019-04-10 21:55:52 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"980190964"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190964], ["LIMIT", 1]] + Rendering tasks/edit.html.erb within layouts/application + Rendered tasks/edit.html.erb within layouts/application (1.3ms) +Completed 200 OK in 5ms (Views: 2.4ms | ActiveRecord: 0.2ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +Started GET "/tasks/-1/edit" for 127.0.0.1 at 2019-04-10 21:55:52 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"-1"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] +Completed 404 Not Found in 1ms (ActiveRecord: 0.3ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.1ms) SAVEPOINT active_record_1 + Task Create (0.2ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "sample task"], ["description", "this is an example for a test"], ["created_at", "2019-04-11 04:55:52.517964"], ["updated_at", "2019-04-11 04:55:52.517964"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Started GET "/tasks/980190965" for 127.0.0.1 at 2019-04-10 21:55:52 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"980190965"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190965], ["LIMIT", 1]] + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.5ms) +Completed 200 OK in 4ms (Views: 1.5ms | ActiveRecord: 0.3ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +Started GET "/tasks/-1" for 127.0.0.1 at 2019-04-10 21:55:52 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"-1"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] +Completed 404 Not Found in 1ms (ActiveRecord: 0.2ms) +  (0.1ms) ROLLBACK +  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.1ms) BEGIN +  (0.3ms) ALTER TABLE "tasks" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN + Fixtures Load (0.5ms) DELETE FROM "tasks"; +INSERT INTO "tasks" ("id", "name", "description", "created_at", "updated_at", "completion_date", "completed") VALUES (980190962, 'MyString', 'MyString', '2019-04-11 04:57:25.164894', '2019-04-11 04:57:25.164894', NULL, DEFAULT), (298486374, 'MyString', 'MyString', '2019-04-11 04:57:25.164894', '2019-04-11 04:57:25.164894', NULL, DEFAULT) +  (0.7ms) COMMIT +  (0.1ms) BEGIN +  (0.4ms) ALTER TABLE "tasks" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.2ms) BEGIN +----------------------------- +Task: test_0001_must be valid +----------------------------- +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.1ms) SAVEPOINT active_record_1 + Task Create (0.3ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "thing"], ["description", "so many things to do!"], ["created_at", "2019-04-11 04:57:25.190390"], ["updated_at", "2019-04-11 04:57:25.190390"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Started GET "/tasks/980190963/edit" for 127.0.0.1 at 2019-04-10 21:57:25 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"980190963"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190963], ["LIMIT", 1]] + Rendering tasks/edit.html.erb within layouts/application + Rendered tasks/edit.html.erb within layouts/application (5.3ms) +Completed 200 OK in 133ms (Views: 125.1ms | ActiveRecord: 0.5ms) +  (0.3ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +Started GET "/tasks/30/edit" for 127.0.0.1 at 2019-04-10 21:57:25 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"30"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 30], ["LIMIT", 1]] +Completed 404 Not Found in 1ms (ActiveRecord: 0.3ms) +  (0.1ms) ROLLBACK +  (0.2ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +Started GET "/tasks/new" for 127.0.0.1 at 2019-04-10 21:57:25 -0700 +Processing by TasksController#new as HTML + Rendering tasks/new.html.erb within layouts/application + Rendered tasks/new.html.erb within layouts/application (1.5ms) +Completed 200 OK in 4ms (Views: 2.4ms | ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-10 21:57:25 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (1.5ms) +Completed 200 OK in 5ms (Views: 2.8ms | ActiveRecord: 0.4ms) +  (0.3ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +Started GET "/" for 127.0.0.1 at 2019-04-10 21:57:25 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (0.7ms) +Completed 200 OK in 2ms (Views: 1.4ms | ActiveRecord: 0.2ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (0.2ms) SELECT COUNT(*) FROM "tasks" +Started POST "/tasks" for 127.0.0.1 at 2019-04-10 21:57:25 -0700 +Processing by TasksController#create as HTML + Parameters: {"task"=>{"name"=>"new task", "description"=>"new task description", "completed"=>"false"}} +  (0.2ms) SAVEPOINT active_record_1 + Task Create (0.3ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "new task"], ["description", "new task description"], ["created_at", "2019-04-11 04:57:25.365263"], ["updated_at", "2019-04-11 04:57:25.365263"]] +  (0.2ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://www.example.com/tasks/980190964 +Completed 302 Found in 2ms (ActiveRecord: 0.6ms) +  (0.3ms) SELECT COUNT(*) FROM "tasks" + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."name" = $1 LIMIT $2 [["name", "new task"], ["LIMIT", 1]] +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.1ms) SAVEPOINT active_record_1 + Task Create (0.2ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "sample task"], ["description", "this is an example for a test"], ["created_at", "2019-04-11 04:57:25.372135"], ["updated_at", "2019-04-11 04:57:25.372135"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Started GET "/tasks/980190965" for 127.0.0.1 at 2019-04-10 21:57:25 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"980190965"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190965], ["LIMIT", 1]] + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.5ms) +Completed 200 OK in 4ms (Views: 1.6ms | ActiveRecord: 0.2ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +Started GET "/tasks/-1" for 127.0.0.1 at 2019-04-10 21:57:25 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"-1"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] +Completed 404 Not Found in 1ms (ActiveRecord: 0.2ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.1ms) BEGIN +  (0.2ms) ALTER TABLE "tasks" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN + Fixtures Load (0.5ms) DELETE FROM "tasks"; +INSERT INTO "tasks" ("id", "name", "description", "created_at", "updated_at", "completion_date", "completed") VALUES (980190962, 'MyString', 'MyString', '2019-04-11 04:58:04.232198', '2019-04-11 04:58:04.232198', NULL, DEFAULT), (298486374, 'MyString', 'MyString', '2019-04-11 04:58:04.232198', '2019-04-11 04:58:04.232198', NULL, DEFAULT) +  (0.6ms) COMMIT +  (0.1ms) BEGIN +  (0.2ms) ALTER TABLE "tasks" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.2ms) SAVEPOINT active_record_1 + Task Create (0.2ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "sample task"], ["description", "this is an example for a test"], ["created_at", "2019-04-11 04:58:04.256943"], ["updated_at", "2019-04-11 04:58:04.256943"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Started GET "/tasks/980190963" for 127.0.0.1 at 2019-04-10 21:58:04 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"980190963"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190963], ["LIMIT", 1]] + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.9ms) +Completed 200 OK in 198ms (Views: 190.4ms | ActiveRecord: 0.3ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +Started GET "/tasks/-1" for 127.0.0.1 at 2019-04-10 21:58:04 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"-1"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] +Completed 404 Not Found in 1ms (ActiveRecord: 0.3ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (0.5ms) SELECT COUNT(*) FROM "tasks" +Started POST "/tasks" for 127.0.0.1 at 2019-04-10 21:58:04 -0700 +Processing by TasksController#create as HTML + Parameters: {"task"=>{"name"=>"new task", "description"=>"new task description", "completed"=>"false"}} +  (0.2ms) SAVEPOINT active_record_1 + Task Create (0.3ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "new task"], ["description", "new task description"], ["created_at", "2019-04-11 04:58:04.476025"], ["updated_at", "2019-04-11 04:58:04.476025"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://www.example.com/tasks/980190964 +Completed 302 Found in 3ms (ActiveRecord: 0.7ms) +  (0.4ms) SELECT COUNT(*) FROM "tasks" + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."name" = $1 LIMIT $2 [["name", "new task"], ["LIMIT", 1]] +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-10 21:58:04 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (1.2ms) +Completed 200 OK in 4ms (Views: 1.8ms | ActiveRecord: 0.3ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +Started GET "/" for 127.0.0.1 at 2019-04-10 21:58:04 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (0.7ms) +Completed 200 OK in 2ms (Views: 1.4ms | ActiveRecord: 0.2ms) +  (0.2ms) ROLLBACK +  (0.2ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +Started GET "/tasks/new" for 127.0.0.1 at 2019-04-10 21:58:04 -0700 +Processing by TasksController#new as HTML + Rendering tasks/new.html.erb within layouts/application + Rendered tasks/new.html.erb within layouts/application (5.3ms) +Completed 200 OK in 9ms (Views: 6.9ms | ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.1ms) SAVEPOINT active_record_1 + Task Create (0.3ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "thing"], ["description", "so many things to do!"], ["created_at", "2019-04-11 04:58:04.510079"], ["updated_at", "2019-04-11 04:58:04.510079"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Started GET "/tasks/980190965/edit" for 127.0.0.1 at 2019-04-10 21:58:04 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"980190965"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190965], ["LIMIT", 1]] + Rendering tasks/edit.html.erb within layouts/application + Rendered tasks/edit.html.erb within layouts/application (1.6ms) +Completed 200 OK in 6ms (Views: 2.8ms | ActiveRecord: 0.3ms) +  (0.2ms) ROLLBACK +  (0.5ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +Started GET "/tasks/30" for 127.0.0.1 at 2019-04-10 21:58:04 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"30"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 30], ["LIMIT", 1]] +Completed 404 Not Found in 1ms (ActiveRecord: 0.2ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------- +Task: test_0001_must be valid +----------------------------- +  (0.1ms) ROLLBACK +  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.1ms) BEGIN +  (0.4ms) ALTER TABLE "tasks" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL +  (0.2ms) COMMIT +  (0.1ms) BEGIN + Fixtures Load (1.2ms) DELETE FROM "tasks"; +INSERT INTO "tasks" ("id", "name", "description", "created_at", "updated_at", "completion_date", "completed") VALUES (980190962, 'MyString', 'MyString', '2019-04-11 04:58:12.649869', '2019-04-11 04:58:12.649869', NULL, DEFAULT), (298486374, 'MyString', 'MyString', '2019-04-11 04:58:12.649869', '2019-04-11 04:58:12.649869', NULL, DEFAULT) +  (0.5ms) COMMIT +  (0.2ms) BEGIN +  (0.1ms) ALTER TABLE "tasks" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.2ms) SAVEPOINT active_record_1 + Task Create (0.3ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "sample task"], ["description", "this is an example for a test"], ["created_at", "2019-04-11 04:58:12.673198"], ["updated_at", "2019-04-11 04:58:12.673198"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Started GET "/tasks/980190963" for 127.0.0.1 at 2019-04-10 21:58:12 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"980190963"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190963], ["LIMIT", 1]] + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (1.3ms) +Completed 200 OK in 197ms (Views: 189.4ms | ActiveRecord: 0.4ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +Started GET "/tasks/-1" for 127.0.0.1 at 2019-04-10 21:58:12 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"-1"} + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] +Completed 404 Not Found in 2ms (ActiveRecord: 0.4ms) +  (0.2ms) ROLLBACK +  (0.2ms) BEGIN +----------------------------- +Task: test_0001_must be valid +----------------------------- +  (0.3ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (0.4ms) SELECT COUNT(*) FROM "tasks" +Started POST "/tasks" for 127.0.0.1 at 2019-04-10 21:58:12 -0700 +Processing by TasksController#create as HTML + Parameters: {"task"=>{"name"=>"new task", "description"=>"new task description", "completed"=>"false"}} +  (0.1ms) SAVEPOINT active_record_1 + Task Create (0.2ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "new task"], ["description", "new task description"], ["created_at", "2019-04-11 04:58:12.896431"], ["updated_at", "2019-04-11 04:58:12.896431"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://www.example.com/tasks/980190964 +Completed 302 Found in 2ms (ActiveRecord: 0.5ms) +  (0.3ms) SELECT COUNT(*) FROM "tasks" + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."name" = $1 LIMIT $2 [["name", "new task"], ["LIMIT", 1]] +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.1ms) SAVEPOINT active_record_1 + Task Create (0.2ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "thing"], ["description", "so many things to do!"], ["created_at", "2019-04-11 04:58:12.901733"], ["updated_at", "2019-04-11 04:58:12.901733"]] +  (0.2ms) RELEASE SAVEPOINT active_record_1 +Started GET "/tasks/980190965/edit" for 127.0.0.1 at 2019-04-10 21:58:12 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"980190965"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190965], ["LIMIT", 1]] + Rendering tasks/edit.html.erb within layouts/application + Rendered tasks/edit.html.erb within layouts/application (6.2ms) +Completed 200 OK in 10ms (Views: 7.3ms | ActiveRecord: 0.2ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +Started GET "/tasks/30/edit" for 127.0.0.1 at 2019-04-10 21:58:12 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"30"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 30], ["LIMIT", 1]] +Completed 404 Not Found in 1ms (ActiveRecord: 0.2ms) +  (0.2ms) ROLLBACK +  (0.3ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-10 21:58:12 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (1.3ms) +Completed 200 OK in 4ms (Views: 2.3ms | ActiveRecord: 0.2ms) +  (0.2ms) ROLLBACK +  (0.2ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +Started GET "/" for 127.0.0.1 at 2019-04-10 21:58:12 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (0.7ms) +Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.3ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +Started GET "/tasks/new" for 127.0.0.1 at 2019-04-10 21:58:12 -0700 +Processing by TasksController#new as HTML + Rendering tasks/new.html.erb within layouts/application + Rendered tasks/new.html.erb within layouts/application (1.7ms) +Completed 200 OK in 5ms (Views: 3.0ms | ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.1ms) BEGIN +  (0.3ms) ALTER TABLE "tasks" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN + Fixtures Load (0.5ms) DELETE FROM "tasks"; +INSERT INTO "tasks" ("id", "name", "description", "created_at", "updated_at", "completion_date", "completed") VALUES (980190962, 'MyString', 'MyString', '2019-04-11 04:59:24.473993', '2019-04-11 04:59:24.473993', NULL, DEFAULT), (298486374, 'MyString', 'MyString', '2019-04-11 04:59:24.473993', '2019-04-11 04:59:24.473993', NULL, DEFAULT) +  (0.3ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) ALTER TABLE "tasks" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------- +Task: test_0001_must be valid +----------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +Started GET "/" for 127.0.0.1 at 2019-04-10 21:59:24 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (2.7ms) +Completed 200 OK in 194ms (Views: 188.1ms | ActiveRecord: 0.4ms) +  (0.1ms) ROLLBACK +  (0.2ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-10 21:59:24 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (0.8ms) +Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.3ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +Started GET "/tasks/new" for 127.0.0.1 at 2019-04-10 21:59:24 -0700 +Processing by TasksController#new as HTML + Rendering tasks/new.html.erb within layouts/application + Rendered tasks/new.html.erb within layouts/application (5.0ms) +Completed 200 OK in 8ms (Views: 5.9ms | ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (0.2ms) SELECT COUNT(*) FROM "tasks" +Started POST "/tasks" for 127.0.0.1 at 2019-04-10 21:59:24 -0700 +Processing by TasksController#create as HTML + Parameters: {"task"=>{"name"=>"new task", "description"=>"new task description", "completed"=>"false"}} +  (0.1ms) SAVEPOINT active_record_1 + Task Create (0.4ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "new task"], ["description", "new task description"], ["created_at", "2019-04-11 04:59:24.722276"], ["updated_at", "2019-04-11 04:59:24.722276"]] +  (0.2ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://www.example.com/tasks/980190963 +Completed 302 Found in 3ms (ActiveRecord: 0.7ms) +  (0.2ms) SELECT COUNT(*) FROM "tasks" + Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."name" = $1 LIMIT $2 [["name", "new task"], ["LIMIT", 1]] +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.2ms) SAVEPOINT active_record_1 + Task Create (0.5ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "thing"], ["description", "so many things to do!"], ["created_at", "2019-04-11 04:59:24.729195"], ["updated_at", "2019-04-11 04:59:24.729195"]] +  (0.2ms) RELEASE SAVEPOINT active_record_1 +Started GET "/tasks/980190964/edit" for 127.0.0.1 at 2019-04-10 21:59:24 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"980190964"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190964], ["LIMIT", 1]] + Rendering tasks/edit.html.erb within layouts/application + Rendered tasks/edit.html.erb within layouts/application (1.2ms) +Completed 200 OK in 5ms (Views: 2.2ms | ActiveRecord: 0.3ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +Started GET "/tasks/30/edit" for 127.0.0.1 at 2019-04-10 21:59:24 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"30"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 30], ["LIMIT", 1]] +Completed 404 Not Found in 1ms (ActiveRecord: 0.2ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.1ms) SAVEPOINT active_record_1 + Task Create (0.2ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "sample task"], ["description", "this is an example for a test"], ["created_at", "2019-04-11 04:59:24.741791"], ["updated_at", "2019-04-11 04:59:24.741791"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Started GET "/tasks/980190965" for 127.0.0.1 at 2019-04-10 21:59:24 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"980190965"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190965], ["LIMIT", 1]] + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.7ms) +Completed 200 OK in 4ms (Views: 1.9ms | ActiveRecord: 0.3ms) +  (0.3ms) ROLLBACK +  (0.2ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +Started GET "/tasks/-1" for 127.0.0.1 at 2019-04-10 21:59:24 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"-1"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] +Completed 404 Not Found in 1ms (ActiveRecord: 0.2ms) +  (0.1ms) ROLLBACK diff --git a/test/controllers/tasks_controller_test.rb b/test/controllers/tasks_controller_test.rb index bbb4281b5..5107ca4b0 100644 --- a/test/controllers/tasks_controller_test.rb +++ b/test/controllers/tasks_controller_test.rb @@ -99,10 +99,9 @@ end it "will respond with redirect when attempting to edit a nonexistant task" do - get edit_task_path(-1) + get edit_task_path(30) must_respond_with :not_found - # redirect to where? task list? show task? end end From aea7af57a0d40842821c958b3fc22d8ae6a7220d Mon Sep 17 00:00:00 2001 From: Kimberly-Fasbender Date: Wed, 10 Apr 2019 22:06:32 -0700 Subject: [PATCH 13/34] updated submit text for edit view --- app/views/tasks/edit.html.erb | 2 +- log/development.log | 41 +++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/app/views/tasks/edit.html.erb b/app/views/tasks/edit.html.erb index 913c9a642..2f115d8dd 100644 --- a/app/views/tasks/edit.html.erb +++ b/app/views/tasks/edit.html.erb @@ -10,7 +10,7 @@ <%= f.label :description %> <%= f.text_field :description %> - <%= f.submit "Add Task", class: "task_button" %> + <%= f.submit "Edit Task", class: "task_button" %> <% end %> <%= link_to "Back to All Tasks", tasks_path %> diff --git a/log/development.log b/log/development.log index a19dadb54..d9df18156 100644 --- a/log/development.log +++ b/log/development.log @@ -1772,3 +1772,44 @@ Processing by TasksController#edit as HTML Completed 404 Not Found in 4ms (ActiveRecord: 1.2ms) +Started GET "/tasks/1/edit" for ::1 at 2019-04-10 22:05:01 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"1"} + Task Load (0.5ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:33 + Rendering tasks/edit.html.erb within layouts/application + Rendered tasks/edit.html.erb within layouts/application (1.6ms) +Completed 200 OK in 36ms (Views: 21.6ms | ActiveRecord: 4.2ms) + + +Started PATCH "/tasks/1" for ::1 at 2019-04-10 22:05:32 -0700 + +ActionController::RoutingError (No route matches [PATCH] "/tasks/1"): + +actionpack (5.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:65:in `call' +web-console (3.7.0) lib/web_console/middleware.rb:135:in `call_app' +web-console (3.7.0) lib/web_console/middleware.rb:30:in `block in call' +web-console (3.7.0) lib/web_console/middleware.rb:20:in `catch' +web-console (3.7.0) lib/web_console/middleware.rb:20:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call' +railties (5.2.3) lib/rails/rack/logger.rb:38:in `call_app' +railties (5.2.3) lib/rails/rack/logger.rb:26:in `block in call' +activesupport (5.2.3) lib/active_support/tagged_logging.rb:71:in `block in tagged' +activesupport (5.2.3) lib/active_support/tagged_logging.rb:28:in `tagged' +activesupport (5.2.3) lib/active_support/tagged_logging.rb:71:in `tagged' +railties (5.2.3) lib/rails/rack/logger.rb:26:in `call' +sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/remote_ip.rb:81:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/request_id.rb:27:in `call' +rack (2.0.7) lib/rack/method_override.rb:22:in `call' +rack (2.0.7) lib/rack/runtime.rb:22:in `call' +activesupport (5.2.3) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/executor.rb:14:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/static.rb:127:in `call' +rack (2.0.7) lib/rack/sendfile.rb:111:in `call' +railties (5.2.3) lib/rails/engine.rb:524:in `call' +puma (3.12.1) lib/puma/configuration.rb:227:in `call' +puma (3.12.1) lib/puma/server.rb:660:in `handle_request' +puma (3.12.1) lib/puma/server.rb:474:in `process_client' +puma (3.12.1) lib/puma/server.rb:334:in `block in run' +puma (3.12.1) lib/puma/thread_pool.rb:135:in `block in spawn_thread' From 53ac53dfc6f685d3fbfd0ce16284011d84d2aab5 Mon Sep 17 00:00:00 2001 From: Kimberly-Fasbender Date: Wed, 10 Apr 2019 22:27:41 -0700 Subject: [PATCH 14/34] added tests for the update action for Tasks controller --- log/development.log | 27 ++ log/test.log | 382 ++++++++++++++++++++++ test/controllers/tasks_controller_test.rb | 31 +- 3 files changed, 435 insertions(+), 5 deletions(-) diff --git a/log/development.log b/log/development.log index d9df18156..7e1c442b7 100644 --- a/log/development.log +++ b/log/development.log @@ -1813,3 +1813,30 @@ puma (3.12.1) lib/puma/server.rb:660:in `handle_request' puma (3.12.1) lib/puma/server.rb:474:in `process_client' puma (3.12.1) lib/puma/server.rb:334:in `block in run' puma (3.12.1) lib/puma/thread_pool.rb:135:in `block in spawn_thread' +Started GET "/" for ::1 at 2019-04-10 22:26:56 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.9ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (3.2ms) +Completed 200 OK in 34ms (Views: 29.9ms | ActiveRecord: 0.9ms) + + +Started GET "/" for ::1 at 2019-04-10 22:26:59 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (1.8ms) +Completed 200 OK in 26ms (Views: 23.2ms | ActiveRecord: 0.4ms) + + +Started GET "/tasks" for ::1 at 2019-04-10 22:27:01 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (2.1ms) +Completed 200 OK in 26ms (Views: 22.5ms | ActiveRecord: 0.3ms) + + diff --git a/log/test.log b/log/test.log index 99f577580..989c37e76 100644 --- a/log/test.log +++ b/log/test.log @@ -3222,3 +3222,385 @@ Processing by TasksController#show as HTML Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] Completed 404 Not Found in 1ms (ActiveRecord: 0.2ms)  (0.1ms) ROLLBACK +  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.2ms) BEGIN +  (0.3ms) ALTER TABLE "tasks" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN + Fixtures Load (0.5ms) DELETE FROM "tasks"; +INSERT INTO "tasks" ("id", "name", "description", "created_at", "updated_at", "completion_date", "completed") VALUES (980190962, 'MyString', 'MyString', '2019-04-11 05:11:26.272423', '2019-04-11 05:11:26.272423', NULL, DEFAULT), (298486374, 'MyString', 'MyString', '2019-04-11 05:11:26.272423', '2019-04-11 05:11:26.272423', NULL, DEFAULT) +  (0.4ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) ALTER TABLE "tasks" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.2ms) SAVEPOINT active_record_1 + Task Create (0.3ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "sample task"], ["description", "this is an example for a test"], ["created_at", "2019-04-11 05:11:26.299817"], ["updated_at", "2019-04-11 05:11:26.299817"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Started GET "/tasks/980190963" for 127.0.0.1 at 2019-04-10 22:11:26 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"980190963"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190963], ["LIMIT", 1]] + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (2.0ms) +Completed 200 OK in 213ms (Views: 198.8ms | ActiveRecord: 0.4ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +Started GET "/tasks/-1" for 127.0.0.1 at 2019-04-10 22:11:26 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"-1"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] +Completed 404 Not Found in 2ms (ActiveRecord: 0.3ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.1ms) SAVEPOINT active_record_1 + Task Create (0.2ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "thing"], ["description", "so many things to do!"], ["created_at", "2019-04-11 05:11:26.527956"], ["updated_at", "2019-04-11 05:11:26.527956"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Started GET "/tasks/980190964/edit" for 127.0.0.1 at 2019-04-10 22:11:26 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"980190964"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190964], ["LIMIT", 1]] + Rendering tasks/edit.html.erb within layouts/application + Rendered tasks/edit.html.erb within layouts/application (10.6ms) +Completed 200 OK in 16ms (Views: 11.8ms | ActiveRecord: 0.3ms) +  (0.5ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +Started GET "/tasks/-1/edit" for 127.0.0.1 at 2019-04-10 22:11:26 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"-1"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] +Completed 404 Not Found in 1ms (ActiveRecord: 0.2ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +Started GET "/tasks/new" for 127.0.0.1 at 2019-04-10 22:11:26 -0700 +Processing by TasksController#new as HTML + Rendering tasks/new.html.erb within layouts/application + Rendered tasks/new.html.erb within layouts/application (1.8ms) +Completed 200 OK in 6ms (Views: 3.9ms | ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.3ms) BEGIN +----------------------------- +Task: test_0001_must be valid +----------------------------- +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (0.4ms) SELECT COUNT(*) FROM "tasks" +Started POST "/tasks" for 127.0.0.1 at 2019-04-10 22:11:26 -0700 +Processing by TasksController#create as HTML + Parameters: {"task"=>{"name"=>"new task", "description"=>"new task description", "completed"=>"false"}} +  (0.2ms) SAVEPOINT active_record_1 + Task Create (0.3ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "new task"], ["description", "new task description"], ["created_at", "2019-04-11 05:11:26.575773"], ["updated_at", "2019-04-11 05:11:26.575773"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://www.example.com/tasks/980190965 +Completed 302 Found in 3ms (ActiveRecord: 0.7ms) +  (0.2ms) SELECT COUNT(*) FROM "tasks" + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."name" = $1 LIMIT $2 [["name", "new task"], ["LIMIT", 1]] +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-10 22:11:26 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (1.1ms) +Completed 200 OK in 4ms (Views: 2.0ms | ActiveRecord: 0.2ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +Started GET "/" for 127.0.0.1 at 2019-04-10 22:11:26 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (0.9ms) +Completed 200 OK in 2ms (Views: 1.8ms | ActiveRecord: 0.3ms) +  (0.1ms) ROLLBACK +  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.7ms) BEGIN +  (0.4ms) ALTER TABLE "tasks" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL +  (0.2ms) COMMIT +  (0.1ms) BEGIN + Fixtures Load (0.5ms) DELETE FROM "tasks"; +INSERT INTO "tasks" ("id", "name", "description", "created_at", "updated_at", "completion_date", "completed") VALUES (980190962, 'MyString', 'MyString', '2019-04-11 05:23:54.501294', '2019-04-11 05:23:54.501294', NULL, DEFAULT), (298486374, 'MyString', 'MyString', '2019-04-11 05:23:54.501294', '2019-04-11 05:23:54.501294', NULL, DEFAULT) +  (0.4ms) COMMIT +  (0.1ms) BEGIN +  (0.2ms) ALTER TABLE "tasks" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +Started GET "/tasks/-1/edit" for 127.0.0.1 at 2019-04-10 22:23:54 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"-1"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] +Completed 404 Not Found in 8ms (ActiveRecord: 0.4ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.2ms) SAVEPOINT active_record_1 + Task Create (0.3ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "thing"], ["description", "so many things to do!"], ["created_at", "2019-04-11 05:23:54.541310"], ["updated_at", "2019-04-11 05:23:54.541310"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Started GET "/tasks/980190963/edit" for 127.0.0.1 at 2019-04-10 22:23:54 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"980190963"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190963], ["LIMIT", 1]] + Rendering tasks/edit.html.erb within layouts/application + Rendered tasks/edit.html.erb within layouts/application (18.4ms) +Completed 200 OK in 231ms (Views: 225.9ms | ActiveRecord: 0.3ms) +  (0.3ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.1ms) SAVEPOINT active_record_1 + Task Create (0.3ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "sample task"], ["description", "this is an example for a test"], ["created_at", "2019-04-11 05:23:54.778971"], ["updated_at", "2019-04-11 05:23:54.778971"]] +  (0.2ms) RELEASE SAVEPOINT active_record_1 +Started GET "/tasks/980190964" for 127.0.0.1 at 2019-04-10 22:23:54 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"980190964"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190964], ["LIMIT", 1]] + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.5ms) +Completed 200 OK in 5ms (Views: 1.9ms | ActiveRecord: 0.2ms) +  (1.3ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +Started GET "/tasks/-1" for 127.0.0.1 at 2019-04-10 22:23:54 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"-1"} + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] +Completed 404 Not Found in 1ms (ActiveRecord: 0.4ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.1ms) SAVEPOINT active_record_1 + Task Create (0.3ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Stuff"], ["description", "Lots of it!"], ["created_at", "2019-04-11 05:23:54.797138"], ["updated_at", "2019-04-11 05:23:54.797138"]] +  (0.2ms) RELEASE SAVEPOINT active_record_1 +  (0.4ms) SELECT COUNT(*) FROM "tasks" +Started PATCH "/tasks/980190965/edit" for 127.0.0.1 at 2019-04-10 22:23:54 -0700 +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.2ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (0.3ms) SELECT COUNT(*) FROM "tasks" +Started POST "/tasks" for 127.0.0.1 at 2019-04-10 22:23:54 -0700 +Processing by TasksController#create as HTML + Parameters: {"task"=>{"name"=>"new task", "description"=>"new task description", "completed"=>"false"}} +  (0.2ms) SAVEPOINT active_record_1 + Task Create (0.4ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "new task"], ["description", "new task description"], ["created_at", "2019-04-11 05:23:54.813155"], ["updated_at", "2019-04-11 05:23:54.813155"]] +  (0.2ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://www.example.com/tasks/980190966 +Completed 302 Found in 3ms (ActiveRecord: 0.8ms) +  (0.2ms) SELECT COUNT(*) FROM "tasks" + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."name" = $1 LIMIT $2 [["name", "new task"], ["LIMIT", 1]] +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-10 22:23:54 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (1.6ms) +Completed 200 OK in 6ms (Views: 3.2ms | ActiveRecord: 0.3ms) +  (0.3ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +Started GET "/" for 127.0.0.1 at 2019-04-10 22:23:54 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (1.2ms) +Completed 200 OK in 3ms (Views: 2.4ms | ActiveRecord: 0.3ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +Started GET "/tasks/new" for 127.0.0.1 at 2019-04-10 22:23:54 -0700 +Processing by TasksController#new as HTML + Rendering tasks/new.html.erb within layouts/application + Rendered tasks/new.html.erb within layouts/application (2.0ms) +Completed 200 OK in 6ms (Views: 3.1ms | ActiveRecord: 0.0ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------- +Task: test_0001_must be valid +----------------------------- +  (0.2ms) ROLLBACK +  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.2ms) BEGIN +  (0.3ms) ALTER TABLE "tasks" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN + Fixtures Load (0.5ms) DELETE FROM "tasks"; +INSERT INTO "tasks" ("id", "name", "description", "created_at", "updated_at", "completion_date", "completed") VALUES (980190962, 'MyString', 'MyString', '2019-04-11 05:27:10.255991', '2019-04-11 05:27:10.255991', NULL, DEFAULT), (298486374, 'MyString', 'MyString', '2019-04-11 05:27:10.255991', '2019-04-11 05:27:10.255991', NULL, DEFAULT) +  (0.8ms) COMMIT +  (0.2ms) BEGIN +  (0.1ms) ALTER TABLE "tasks" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.2ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.1ms) SAVEPOINT active_record_1 + Task Create (0.3ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Stuff"], ["description", "Lots of it!"], ["created_at", "2019-04-11 05:27:10.281949"], ["updated_at", "2019-04-11 05:27:10.281949"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.2ms) SELECT COUNT(*) FROM "tasks" +Started PATCH "/tasks/980190963/edit" for 127.0.0.1 at 2019-04-10 22:27:10 -0700 +  (0.2ms) ROLLBACK +  (0.2ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.8ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +Started GET "/tasks/new" for 127.0.0.1 at 2019-04-10 22:27:10 -0700 +Processing by TasksController#new as HTML + Rendering tasks/new.html.erb within layouts/application + Rendered tasks/new.html.erb within layouts/application (6.3ms) +Completed 200 OK in 164ms (Views: 158.4ms | ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (0.3ms) SELECT COUNT(*) FROM "tasks" +Started POST "/tasks" for 127.0.0.1 at 2019-04-10 22:27:10 -0700 +Processing by TasksController#create as HTML + Parameters: {"task"=>{"name"=>"new task", "description"=>"new task description", "completed"=>"false"}} +  (0.2ms) SAVEPOINT active_record_1 + Task Create (0.3ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "new task"], ["description", "new task description"], ["created_at", "2019-04-11 05:27:10.518101"], ["updated_at", "2019-04-11 05:27:10.518101"]] +  (0.2ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://www.example.com/tasks/980190964 +Completed 302 Found in 3ms (ActiveRecord: 0.6ms) +  (0.2ms) SELECT COUNT(*) FROM "tasks" + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."name" = $1 LIMIT $2 [["name", "new task"], ["LIMIT", 1]] +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +Started GET "/" for 127.0.0.1 at 2019-04-10 22:27:10 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (1.1ms) +Completed 200 OK in 4ms (Views: 2.0ms | ActiveRecord: 0.3ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-10 22:27:10 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (0.6ms) +Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.2ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------- +Task: test_0001_must be valid +----------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +Started GET "/tasks/-1/edit" for 127.0.0.1 at 2019-04-10 22:27:10 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"-1"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] +Completed 404 Not Found in 1ms (ActiveRecord: 0.2ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.1ms) SAVEPOINT active_record_1 + Task Create (0.2ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "thing"], ["description", "so many things to do!"], ["created_at", "2019-04-11 05:27:10.541003"], ["updated_at", "2019-04-11 05:27:10.541003"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Started GET "/tasks/980190965/edit" for 127.0.0.1 at 2019-04-10 22:27:10 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"980190965"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190965], ["LIMIT", 1]] + Rendering tasks/edit.html.erb within layouts/application + Rendered tasks/edit.html.erb within layouts/application (1.3ms) +Completed 200 OK in 5ms (Views: 2.3ms | ActiveRecord: 0.2ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.1ms) SAVEPOINT active_record_1 + Task Create (0.3ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "sample task"], ["description", "this is an example for a test"], ["created_at", "2019-04-11 05:27:10.550782"], ["updated_at", "2019-04-11 05:27:10.550782"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Started GET "/tasks/980190966" for 127.0.0.1 at 2019-04-10 22:27:10 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"980190966"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190966], ["LIMIT", 1]] + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.6ms) +Completed 200 OK in 6ms (Views: 2.0ms | ActiveRecord: 0.2ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +Started GET "/tasks/-1" for 127.0.0.1 at 2019-04-10 22:27:10 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"-1"} + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] +Completed 404 Not Found in 1ms (ActiveRecord: 0.4ms) +  (0.2ms) ROLLBACK diff --git a/test/controllers/tasks_controller_test.rb b/test/controllers/tasks_controller_test.rb index 5107ca4b0..9ee66058a 100644 --- a/test/controllers/tasks_controller_test.rb +++ b/test/controllers/tasks_controller_test.rb @@ -99,7 +99,7 @@ end it "will respond with redirect when attempting to edit a nonexistant task" do - get edit_task_path(30) + get edit_task_path(-1) must_respond_with :not_found end @@ -110,13 +110,34 @@ # Note: If there was a way to fail to save the changes to a task, that would be a great # thing to test. it "can update an existing task" do - skip - # Your code here + task_hash = { + task: { + name: "new task", + description: "new task description", + completed: false, + }, + } + + new_task = Task.create(name: "Stuff", description: "Lots of it!") + + # Act-Assert + expect { + patch edit_task_path(new_task.id), params: task_hash + }.must_change "Task.count", 0 + + updated_task = Task.find_by(id: new_task.id) + expect(updated_task.name).must_equal task_hash[:task][:name] + expect(updated_task.description).must_equal task_hash[:task][:description] + expect(updated_task.completed).must_equal task_hash[:task][:completed] + + must_respond_with :redirect + must_redirect_to task_path(new_task.id) end it "will redirect to the root page if given an invalid id" do - skip - # Your code here + expect { + edit_task_path(-1) + }.must_redirect_to root_path end end From 6e74ef0cda03acfea9f6e7107a698a6e90c13743 Mon Sep 17 00:00:00 2001 From: Kimberly-Fasbender Date: Wed, 10 Apr 2019 22:44:08 -0700 Subject: [PATCH 15/34] added update action to Tasks Controller passing 1/2 tests --- app/controllers/tasks_controller.rb | 13 + config/routes.rb | 2 +- log/development.log | 166 +++++ log/test.log | 804 ++++++++++++++++++++++ test/controllers/tasks_controller_test.rb | 4 +- 5 files changed, 986 insertions(+), 3 deletions(-) diff --git a/app/controllers/tasks_controller.rb b/app/controllers/tasks_controller.rb index d810760d3..ef98ff05a 100644 --- a/app/controllers/tasks_controller.rb +++ b/app/controllers/tasks_controller.rb @@ -34,4 +34,17 @@ def edit head :not_found if @task.nil? end + + def update + task_id = params[:id] + task = Task.find_by(id: task_id) + task.name = params[:task][:name] + task.description = params[:task][:description] + + if task.save + redirect_to task_path(task.id) + else + head :bad_request + end + end end diff --git a/config/routes.rb b/config/routes.rb index 20d88fd7b..b26748772 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -7,7 +7,7 @@ get "/tasks/:id", to: "tasks#show", as: "task" get "/tasks/:id/edit", to: "tasks#edit", as: "edit_task" - patch "/tasks:id", to: "tasks#update" + patch "/tasks/:id", to: "tasks#update" root to: "tasks#index" # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html diff --git a/log/development.log b/log/development.log index 7e1c442b7..86acaacdf 100644 --- a/log/development.log +++ b/log/development.log @@ -1840,3 +1840,169 @@ Processing by TasksController#index as HTML Completed 200 OK in 26ms (Views: 22.5ms | ActiveRecord: 0.3ms) +Started GET "/tasks" for ::1 at 2019-04-10 22:35:43 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.6ms) SELECT "tasks".* FROM "tasks" + ↳ app/views/tasks/index.html.erb:3 + Rendered tasks/index.html.erb within layouts/application (14.3ms) +Completed 200 OK in 35ms (Views: 23.8ms | ActiveRecord: 7.7ms) + + +Started GET "/tasks/4" for ::1 at 2019-04-10 22:35:46 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"4"} + Task Load (0.9ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 4], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (1.1ms) +Completed 200 OK in 40ms (Views: 32.7ms | ActiveRecord: 1.6ms) + + +Started GET "/tasks/2" for ::1 at 2019-04-10 22:35:50 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"2"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 2], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.8ms) +Completed 200 OK in 31ms (Views: 27.2ms | ActiveRecord: 0.3ms) + + +Started GET "/tasks/2/edit" for ::1 at 2019-04-10 22:35:51 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"2"} + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 2], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:33 + Rendering tasks/edit.html.erb within layouts/application + Rendered tasks/edit.html.erb within layouts/application (3.5ms) +Completed 200 OK in 38ms (Views: 33.2ms | ActiveRecord: 0.4ms) + + +Started PATCH "/tasks/2" for ::1 at 2019-04-10 22:35:57 -0700 + +ActionController::RoutingError (No route matches [PATCH] "/tasks/2"): + +actionpack (5.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:65:in `call' +web-console (3.7.0) lib/web_console/middleware.rb:135:in `call_app' +web-console (3.7.0) lib/web_console/middleware.rb:30:in `block in call' +web-console (3.7.0) lib/web_console/middleware.rb:20:in `catch' +web-console (3.7.0) lib/web_console/middleware.rb:20:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call' +railties (5.2.3) lib/rails/rack/logger.rb:38:in `call_app' +railties (5.2.3) lib/rails/rack/logger.rb:26:in `block in call' +activesupport (5.2.3) lib/active_support/tagged_logging.rb:71:in `block in tagged' +activesupport (5.2.3) lib/active_support/tagged_logging.rb:28:in `tagged' +activesupport (5.2.3) lib/active_support/tagged_logging.rb:71:in `tagged' +railties (5.2.3) lib/rails/rack/logger.rb:26:in `call' +sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/remote_ip.rb:81:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/request_id.rb:27:in `call' +rack (2.0.7) lib/rack/method_override.rb:22:in `call' +rack (2.0.7) lib/rack/runtime.rb:22:in `call' +activesupport (5.2.3) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/executor.rb:14:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/static.rb:127:in `call' +rack (2.0.7) lib/rack/sendfile.rb:111:in `call' +railties (5.2.3) lib/rails/engine.rb:524:in `call' +puma (3.12.1) lib/puma/configuration.rb:227:in `call' +puma (3.12.1) lib/puma/server.rb:660:in `handle_request' +puma (3.12.1) lib/puma/server.rb:474:in `process_client' +puma (3.12.1) lib/puma/server.rb:334:in `block in run' +puma (3.12.1) lib/puma/thread_pool.rb:135:in `block in spawn_thread' +Started GET "/tasks/2" for ::1 at 2019-04-10 22:40:02 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"2"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 2], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.6ms) +Completed 200 OK in 44ms (Views: 28.1ms | ActiveRecord: 3.5ms) + + +Started GET "/tasks/2/edit" for ::1 at 2019-04-10 22:40:05 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"2"} + Task Load (2.9ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 2], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:33 + Rendering tasks/edit.html.erb within layouts/application + Rendered tasks/edit.html.erb within layouts/application (3.5ms) +Completed 200 OK in 37ms (Views: 28.9ms | ActiveRecord: 2.9ms) + + +Started PATCH "/tasks/2" for ::1 at 2019-04-10 22:40:11 -0700 + +ActionController::RoutingError (No route matches [PATCH] "/tasks/2"): + +actionpack (5.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:65:in `call' +web-console (3.7.0) lib/web_console/middleware.rb:135:in `call_app' +web-console (3.7.0) lib/web_console/middleware.rb:30:in `block in call' +web-console (3.7.0) lib/web_console/middleware.rb:20:in `catch' +web-console (3.7.0) lib/web_console/middleware.rb:20:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call' +railties (5.2.3) lib/rails/rack/logger.rb:38:in `call_app' +railties (5.2.3) lib/rails/rack/logger.rb:26:in `block in call' +activesupport (5.2.3) lib/active_support/tagged_logging.rb:71:in `block in tagged' +activesupport (5.2.3) lib/active_support/tagged_logging.rb:28:in `tagged' +activesupport (5.2.3) lib/active_support/tagged_logging.rb:71:in `tagged' +railties (5.2.3) lib/rails/rack/logger.rb:26:in `call' +sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/remote_ip.rb:81:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/request_id.rb:27:in `call' +rack (2.0.7) lib/rack/method_override.rb:22:in `call' +rack (2.0.7) lib/rack/runtime.rb:22:in `call' +activesupport (5.2.3) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/executor.rb:14:in `call' +actionpack (5.2.3) lib/action_dispatch/middleware/static.rb:127:in `call' +rack (2.0.7) lib/rack/sendfile.rb:111:in `call' +railties (5.2.3) lib/rails/engine.rb:524:in `call' +puma (3.12.1) lib/puma/configuration.rb:227:in `call' +puma (3.12.1) lib/puma/server.rb:660:in `handle_request' +puma (3.12.1) lib/puma/server.rb:474:in `process_client' +puma (3.12.1) lib/puma/server.rb:334:in `block in run' +puma (3.12.1) lib/puma/thread_pool.rb:135:in `block in spawn_thread' +Started GET "/tasks/2" for ::1 at 2019-04-10 22:41:21 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"2"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 2], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.6ms) +Completed 200 OK in 33ms (Views: 18.8ms | ActiveRecord: 3.3ms) + + +Started GET "/tasks/2/edit" for ::1 at 2019-04-10 22:41:23 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"2"} + Task Load (2.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 2], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:33 + Rendering tasks/edit.html.erb within layouts/application + Rendered tasks/edit.html.erb within layouts/application (3.4ms) +Completed 200 OK in 36ms (Views: 29.0ms | ActiveRecord: 2.2ms) + + +Started PATCH "/tasks/2" for ::1 at 2019-04-10 22:41:26 -0700 +Processing by TasksController#update as HTML + Parameters: {"utf8"=>"✓", "authenticity_token"=>"5+cji1tdSuslPgnf00jIU4yMoJ2Gg3Ib5Ko6iAyll3lxyM80NJLUPL74drNE631cCcd4DHM2EGGJvf7FwaJ0hA==", "task"=>{"name"=>"Practice Rails!!", "description"=>"Break all the things, google all the things, ask all the questions."}, "commit"=>"Edit Task", "id"=>"2"} + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 2], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:40 +  (0.2ms) BEGIN + ↳ app/controllers/tasks_controller.rb:44 + Task Update (0.6ms) UPDATE "tasks" SET "name" = $1, "updated_at" = $2 WHERE "tasks"."id" = $3 [["name", "Practice Rails!!"], ["updated_at", "2019-04-11 05:41:26.816047"], ["id", 2]] + ↳ app/controllers/tasks_controller.rb:44 +  (0.5ms) COMMIT + ↳ app/controllers/tasks_controller.rb:44 +Redirected to http://localhost:3000/tasks/2 +Completed 302 Found in 7ms (ActiveRecord: 1.7ms) + + +Started GET "/tasks/2" for ::1 at 2019-04-10 22:41:26 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"2"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 2], ["LIMIT", 1]] + ↳ app/controllers/tasks_controller.rb:8 + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.9ms) +Completed 200 OK in 34ms (Views: 29.6ms | ActiveRecord: 0.3ms) + + diff --git a/log/test.log b/log/test.log index 989c37e76..aee0211d2 100644 --- a/log/test.log +++ b/log/test.log @@ -3604,3 +3604,807 @@ Processing by TasksController#show as HTML Task Load (0.4ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] Completed 404 Not Found in 1ms (ActiveRecord: 0.4ms)  (0.2ms) ROLLBACK +  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.1ms) BEGIN +  (0.4ms) ALTER TABLE "tasks" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.2ms) BEGIN + Fixtures Load (0.6ms) DELETE FROM "tasks"; +INSERT INTO "tasks" ("id", "name", "description", "created_at", "updated_at", "completion_date", "completed") VALUES (980190962, 'MyString', 'MyString', '2019-04-11 05:33:12.148110', '2019-04-11 05:33:12.148110', NULL, DEFAULT), (298486374, 'MyString', 'MyString', '2019-04-11 05:33:12.148110', '2019-04-11 05:33:12.148110', NULL, DEFAULT) +  (0.4ms) COMMIT +  (0.2ms) BEGIN +  (0.2ms) ALTER TABLE "tasks" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-10 22:33:12 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (9.4ms) +Completed 200 OK in 194ms (Views: 188.3ms | ActiveRecord: 0.3ms) +  (0.3ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +Started GET "/" for 127.0.0.1 at 2019-04-10 22:33:12 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (1.1ms) +Completed 200 OK in 3ms (Views: 2.1ms | ActiveRecord: 0.3ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +Started GET "/tasks/new" for 127.0.0.1 at 2019-04-10 22:33:12 -0700 +Processing by TasksController#new as HTML + Rendering tasks/new.html.erb within layouts/application + Rendered tasks/new.html.erb within layouts/application (6.4ms) +Completed 200 OK in 10ms (Views: 7.4ms | ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.1ms) SAVEPOINT active_record_1 + Task Create (0.2ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "thing"], ["description", "so many things to do!"], ["created_at", "2019-04-11 05:33:12.399413"], ["updated_at", "2019-04-11 05:33:12.399413"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Started GET "/tasks/980190963/edit" for 127.0.0.1 at 2019-04-10 22:33:12 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"980190963"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190963], ["LIMIT", 1]] + Rendering tasks/edit.html.erb within layouts/application + Rendered tasks/edit.html.erb within layouts/application (1.6ms) +Completed 200 OK in 7ms (Views: 3.0ms | ActiveRecord: 0.4ms) +  (0.2ms) ROLLBACK +  (0.2ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +Started GET "/tasks/-1/edit" for 127.0.0.1 at 2019-04-10 22:33:12 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"-1"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] +Completed 404 Not Found in 1ms (ActiveRecord: 0.2ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------- +Task: test_0001_must be valid +----------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.1ms) SAVEPOINT active_record_1 + Task Create (0.2ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Stuff"], ["description", "Lots of it!"], ["created_at", "2019-04-11 05:33:12.417088"], ["updated_at", "2019-04-11 05:33:12.417088"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.2ms) SELECT COUNT(*) FROM "tasks" +Started PATCH "/tasks/980190964/edit" for 127.0.0.1 at 2019-04-10 22:33:12 -0700 +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.2ms) SAVEPOINT active_record_1 + Task Create (0.3ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "sample task"], ["description", "this is an example for a test"], ["created_at", "2019-04-11 05:33:12.474423"], ["updated_at", "2019-04-11 05:33:12.474423"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Started GET "/tasks/980190965" for 127.0.0.1 at 2019-04-10 22:33:12 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"980190965"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190965], ["LIMIT", 1]] + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.5ms) +Completed 200 OK in 5ms (Views: 1.7ms | ActiveRecord: 0.3ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +Started GET "/tasks/-1" for 127.0.0.1 at 2019-04-10 22:33:12 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"-1"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] +Completed 404 Not Found in 1ms (ActiveRecord: 0.3ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (0.2ms) SELECT COUNT(*) FROM "tasks" +Started POST "/tasks" for 127.0.0.1 at 2019-04-10 22:33:12 -0700 +Processing by TasksController#create as HTML + Parameters: {"task"=>{"name"=>"new task", "description"=>"new task description", "completed"=>"false"}} +  (0.2ms) SAVEPOINT active_record_1 + Task Create (0.2ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "new task"], ["description", "new task description"], ["created_at", "2019-04-11 05:33:12.498497"], ["updated_at", "2019-04-11 05:33:12.498497"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://www.example.com/tasks/980190966 +Completed 302 Found in 2ms (ActiveRecord: 0.4ms) +  (0.2ms) SELECT COUNT(*) FROM "tasks" + Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."name" = $1 LIMIT $2 [["name", "new task"], ["LIMIT", 1]] +  (0.1ms) ROLLBACK +  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.1ms) BEGIN +  (0.3ms) ALTER TABLE "tasks" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN + Fixtures Load (0.6ms) DELETE FROM "tasks"; +INSERT INTO "tasks" ("id", "name", "description", "created_at", "updated_at", "completion_date", "completed") VALUES (980190962, 'MyString', 'MyString', '2019-04-11 05:34:20.930662', '2019-04-11 05:34:20.930662', NULL, DEFAULT), (298486374, 'MyString', 'MyString', '2019-04-11 05:34:20.930662', '2019-04-11 05:34:20.930662', NULL, DEFAULT) +  (0.6ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) ALTER TABLE "tasks" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (0.2ms) SELECT COUNT(*) FROM "tasks" +Started POST "/tasks" for 127.0.0.1 at 2019-04-10 22:34:20 -0700 +Processing by TasksController#create as HTML + Parameters: {"task"=>{"name"=>"new task", "description"=>"new task description", "completed"=>"false"}} +  (0.2ms) SAVEPOINT active_record_1 + Task Create (0.4ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "new task"], ["description", "new task description"], ["created_at", "2019-04-11 05:34:20.964670"], ["updated_at", "2019-04-11 05:34:20.964670"]] +  (0.2ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://www.example.com/tasks/980190963 +Completed 302 Found in 14ms (ActiveRecord: 0.8ms) +  (0.3ms) SELECT COUNT(*) FROM "tasks" + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."name" = $1 LIMIT $2 [["name", "new task"], ["LIMIT", 1]] +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.2ms) SAVEPOINT active_record_1 + Task Create (0.2ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Stuff"], ["description", "Lots of it!"], ["created_at", "2019-04-11 05:34:20.972989"], ["updated_at", "2019-04-11 05:34:20.972989"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.1ms) SELECT COUNT(*) FROM "tasks" +Started PATCH "/tasks/980190964" for 127.0.0.1 at 2019-04-10 22:34:20 -0700 +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.2ms) BEGIN +----------------------------- +Task: test_0001_must be valid +----------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.1ms) SAVEPOINT active_record_1 + Task Create (0.4ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "thing"], ["description", "so many things to do!"], ["created_at", "2019-04-11 05:34:21.008102"], ["updated_at", "2019-04-11 05:34:21.008102"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Started GET "/tasks/980190965/edit" for 127.0.0.1 at 2019-04-10 22:34:21 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"980190965"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190965], ["LIMIT", 1]] + Rendering tasks/edit.html.erb within layouts/application + Rendered tasks/edit.html.erb within layouts/application (8.0ms) +Completed 200 OK in 192ms (Views: 189.1ms | ActiveRecord: 0.2ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +Started GET "/tasks/-1/edit" for 127.0.0.1 at 2019-04-10 22:34:21 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"-1"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] +Completed 404 Not Found in 1ms (ActiveRecord: 0.3ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +Started GET "/" for 127.0.0.1 at 2019-04-10 22:34:21 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (1.2ms) +Completed 200 OK in 5ms (Views: 2.4ms | ActiveRecord: 0.3ms) +  (0.2ms) ROLLBACK +  (0.2ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-10 22:34:21 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (0.9ms) +Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.3ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.1ms) SAVEPOINT active_record_1 + Task Create (0.2ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "sample task"], ["description", "this is an example for a test"], ["created_at", "2019-04-11 05:34:21.223451"], ["updated_at", "2019-04-11 05:34:21.223451"]] +  (0.2ms) RELEASE SAVEPOINT active_record_1 +Started GET "/tasks/980190966" for 127.0.0.1 at 2019-04-10 22:34:21 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"980190966"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190966], ["LIMIT", 1]] + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.6ms) +Completed 200 OK in 3ms (Views: 1.4ms | ActiveRecord: 0.2ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +Started GET "/tasks/-1" for 127.0.0.1 at 2019-04-10 22:34:21 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"-1"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] +Completed 404 Not Found in 1ms (ActiveRecord: 0.2ms) +  (0.1ms) ROLLBACK +  (0.2ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +Started GET "/tasks/new" for 127.0.0.1 at 2019-04-10 22:34:21 -0700 +Processing by TasksController#new as HTML + Rendering tasks/new.html.erb within layouts/application + Rendered tasks/new.html.erb within layouts/application (1.8ms) +Completed 200 OK in 5ms (Views: 3.0ms | ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.1ms) BEGIN +  (0.3ms) ALTER TABLE "tasks" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN + Fixtures Load (0.5ms) DELETE FROM "tasks"; +INSERT INTO "tasks" ("id", "name", "description", "created_at", "updated_at", "completion_date", "completed") VALUES (980190962, 'MyString', 'MyString', '2019-04-11 05:35:07.740667', '2019-04-11 05:35:07.740667', NULL, DEFAULT), (298486374, 'MyString', 'MyString', '2019-04-11 05:35:07.740667', '2019-04-11 05:35:07.740667', NULL, DEFAULT) +  (0.8ms) COMMIT +  (0.1ms) BEGIN +  (0.2ms) ALTER TABLE "tasks" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +Started GET "/tasks/new" for 127.0.0.1 at 2019-04-10 22:35:07 -0700 +Processing by TasksController#new as HTML + Rendering tasks/new.html.erb within layouts/application + Rendered tasks/new.html.erb within layouts/application (5.6ms) +Completed 200 OK in 205ms (Views: 193.9ms | ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.2ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.2ms) ROLLBACK +  (0.2ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.1ms) SAVEPOINT active_record_1 + Task Create (0.4ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Stuff"], ["description", "Lots of it!"], ["created_at", "2019-04-11 05:35:07.973563"], ["updated_at", "2019-04-11 05:35:07.973563"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.3ms) SELECT COUNT(*) FROM "tasks" +Started PATCH "/tasks/980190963" for 127.0.0.1 at 2019-04-10 22:35:07 -0700 +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (0.3ms) SELECT COUNT(*) FROM "tasks" +Started POST "/tasks" for 127.0.0.1 at 2019-04-10 22:35:07 -0700 +Processing by TasksController#create as HTML + Parameters: {"task"=>{"name"=>"new task", "description"=>"new task description", "completed"=>"false"}} +  (0.2ms) SAVEPOINT active_record_1 + Task Create (0.3ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "new task"], ["description", "new task description"], ["created_at", "2019-04-11 05:35:07.985334"], ["updated_at", "2019-04-11 05:35:07.985334"]] +  (0.2ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://www.example.com/tasks/980190964 +Completed 302 Found in 3ms (ActiveRecord: 0.7ms) +  (0.3ms) SELECT COUNT(*) FROM "tasks" + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."name" = $1 LIMIT $2 [["name", "new task"], ["LIMIT", 1]] +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +Started GET "/tasks/-1" for 127.0.0.1 at 2019-04-10 22:35:07 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"-1"} + Task Load (0.8ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] +Completed 404 Not Found in 5ms (ActiveRecord: 0.8ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.1ms) SAVEPOINT active_record_1 + Task Create (0.2ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "sample task"], ["description", "this is an example for a test"], ["created_at", "2019-04-11 05:35:08.003075"], ["updated_at", "2019-04-11 05:35:08.003075"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Started GET "/tasks/980190965" for 127.0.0.1 at 2019-04-10 22:35:08 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"980190965"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190965], ["LIMIT", 1]] + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.5ms) +Completed 200 OK in 5ms (Views: 2.0ms | ActiveRecord: 0.3ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.1ms) SAVEPOINT active_record_1 + Task Create (0.2ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "thing"], ["description", "so many things to do!"], ["created_at", "2019-04-11 05:35:08.012669"], ["updated_at", "2019-04-11 05:35:08.012669"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Started GET "/tasks/980190966/edit" for 127.0.0.1 at 2019-04-10 22:35:08 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"980190966"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190966], ["LIMIT", 1]] + Rendering tasks/edit.html.erb within layouts/application + Rendered tasks/edit.html.erb within layouts/application (1.5ms) +Completed 200 OK in 5ms (Views: 2.5ms | ActiveRecord: 0.2ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +Started GET "/tasks/-1/edit" for 127.0.0.1 at 2019-04-10 22:35:08 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"-1"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] +Completed 404 Not Found in 1ms (ActiveRecord: 0.2ms) +  (0.1ms) ROLLBACK +  (0.2ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +Started GET "/" for 127.0.0.1 at 2019-04-10 22:35:08 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (1.0ms) +Completed 200 OK in 4ms (Views: 1.8ms | ActiveRecord: 0.2ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-10 22:35:08 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (0.7ms) +Completed 200 OK in 2ms (Views: 1.4ms | ActiveRecord: 0.3ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------- +Task: test_0001_must be valid +----------------------------- +  (0.1ms) ROLLBACK +  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.2ms) BEGIN +  (0.3ms) ALTER TABLE "tasks" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.2ms) BEGIN + Fixtures Load (0.4ms) DELETE FROM "tasks"; +INSERT INTO "tasks" ("id", "name", "description", "created_at", "updated_at", "completion_date", "completed") VALUES (980190962, 'MyString', 'MyString', '2019-04-11 05:41:35.948429', '2019-04-11 05:41:35.948429', NULL, DEFAULT), (298486374, 'MyString', 'MyString', '2019-04-11 05:41:35.948429', '2019-04-11 05:41:35.948429', NULL, DEFAULT) +  (0.5ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) ALTER TABLE "tasks" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.2ms) SAVEPOINT active_record_1 + Task Create (0.8ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "sample task"], ["description", "this is an example for a test"], ["created_at", "2019-04-11 05:41:35.972783"], ["updated_at", "2019-04-11 05:41:35.972783"]] +  (0.4ms) RELEASE SAVEPOINT active_record_1 +Started GET "/tasks/980190963" for 127.0.0.1 at 2019-04-10 22:41:35 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"980190963"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190963], ["LIMIT", 1]] + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (1.1ms) +Completed 200 OK in 201ms (Views: 192.6ms | ActiveRecord: 0.6ms) +  (0.2ms) ROLLBACK +  (0.2ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +Started GET "/tasks/-1" for 127.0.0.1 at 2019-04-10 22:41:36 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"-1"} + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] +Completed 404 Not Found in 1ms (ActiveRecord: 0.4ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.1ms) SAVEPOINT active_record_1 + Task Create (0.3ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "thing"], ["description", "so many things to do!"], ["created_at", "2019-04-11 05:41:36.193709"], ["updated_at", "2019-04-11 05:41:36.193709"]] +  (0.2ms) RELEASE SAVEPOINT active_record_1 +Started GET "/tasks/980190964/edit" for 127.0.0.1 at 2019-04-10 22:41:36 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"980190964"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190964], ["LIMIT", 1]] + Rendering tasks/edit.html.erb within layouts/application + Rendered tasks/edit.html.erb within layouts/application (4.6ms) +Completed 200 OK in 10ms (Views: 6.6ms | ActiveRecord: 0.3ms) +  (0.1ms) ROLLBACK +  (0.2ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +Started GET "/tasks/-1/edit" for 127.0.0.1 at 2019-04-10 22:41:36 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"-1"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] +Completed 404 Not Found in 1ms (ActiveRecord: 0.2ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (0.2ms) SELECT COUNT(*) FROM "tasks" +Started POST "/tasks" for 127.0.0.1 at 2019-04-10 22:41:36 -0700 +Processing by TasksController#create as HTML + Parameters: {"task"=>{"name"=>"new task", "description"=>"new task description", "completed"=>"false"}} +  (0.2ms) SAVEPOINT active_record_1 + Task Create (0.3ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "new task"], ["description", "new task description"], ["created_at", "2019-04-11 05:41:36.218015"], ["updated_at", "2019-04-11 05:41:36.218015"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://www.example.com/tasks/980190965 +Completed 302 Found in 3ms (ActiveRecord: 0.6ms) +  (0.3ms) SELECT COUNT(*) FROM "tasks" + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."name" = $1 LIMIT $2 [["name", "new task"], ["LIMIT", 1]] +  (0.2ms) ROLLBACK +  (0.6ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.2ms) SAVEPOINT active_record_1 + Task Create (0.3ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Stuff"], ["description", "Lots of it!"], ["created_at", "2019-04-11 05:41:36.226278"], ["updated_at", "2019-04-11 05:41:36.226278"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.2ms) SELECT COUNT(*) FROM "tasks" +Started PATCH "/tasks/980190966" for 127.0.0.1 at 2019-04-10 22:41:36 -0700 +Processing by TasksController#update as HTML + Parameters: {"task"=>{"name"=>"new task", "description"=>"new task description", "completed"=>"false"}, "id"=>"980190966"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190966], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Task Update (0.3ms) UPDATE "tasks" SET "name" = $1, "description" = $2, "updated_at" = $3 WHERE "tasks"."id" = $4 [["name", "new task"], ["description", "new task description"], ["updated_at", "2019-04-11 05:41:36.230605"], ["id", 980190966]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://www.example.com/tasks/980190966 +Completed 302 Found in 3ms (ActiveRecord: 0.7ms) +  (0.3ms) SELECT COUNT(*) FROM "tasks" + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190966], ["LIMIT", 1]] +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-10 22:41:36 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (1.1ms) +Completed 200 OK in 5ms (Views: 1.8ms | ActiveRecord: 0.2ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +Started GET "/" for 127.0.0.1 at 2019-04-10 22:41:36 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (0.6ms) +Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.2ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------- +Task: test_0001_must be valid +----------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +Started GET "/tasks/new" for 127.0.0.1 at 2019-04-10 22:41:36 -0700 +Processing by TasksController#new as HTML + Rendering tasks/new.html.erb within layouts/application + Rendered tasks/new.html.erb within layouts/application (1.4ms) +Completed 200 OK in 4ms (Views: 2.4ms | ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.1ms) BEGIN +  (0.3ms) ALTER TABLE "tasks" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN + Fixtures Load (0.4ms) DELETE FROM "tasks"; +INSERT INTO "tasks" ("id", "name", "description", "created_at", "updated_at", "completion_date", "completed") VALUES (980190962, 'MyString', 'MyString', '2019-04-11 05:42:26.089496', '2019-04-11 05:42:26.089496', NULL, DEFAULT), (298486374, 'MyString', 'MyString', '2019-04-11 05:42:26.089496', '2019-04-11 05:42:26.089496', NULL, DEFAULT) +  (0.6ms) COMMIT +  (0.1ms) BEGIN +  (0.1ms) ALTER TABLE "tasks" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.3ms) SAVEPOINT active_record_1 + Task Create (0.4ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "thing"], ["description", "so many things to do!"], ["created_at", "2019-04-11 05:42:26.112338"], ["updated_at", "2019-04-11 05:42:26.112338"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Started GET "/tasks/980190963/edit" for 127.0.0.1 at 2019-04-10 22:42:26 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"980190963"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190963], ["LIMIT", 1]] + Rendering tasks/edit.html.erb within layouts/application + Rendered tasks/edit.html.erb within layouts/application (6.0ms) +Completed 200 OK in 191ms (Views: 180.7ms | ActiveRecord: 0.4ms) +  (0.4ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +Started GET "/tasks/-1/edit" for 127.0.0.1 at 2019-04-10 22:42:26 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"-1"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] +Completed 404 Not Found in 1ms (ActiveRecord: 0.3ms) +  (0.6ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.1ms) SAVEPOINT active_record_1 + Task Create (0.3ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "sample task"], ["description", "this is an example for a test"], ["created_at", "2019-04-11 05:42:26.321335"], ["updated_at", "2019-04-11 05:42:26.321335"]] +  (0.2ms) RELEASE SAVEPOINT active_record_1 +Started GET "/tasks/980190964" for 127.0.0.1 at 2019-04-10 22:42:26 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"980190964"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190964], ["LIMIT", 1]] + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (0.7ms) +Completed 200 OK in 8ms (Views: 2.2ms | ActiveRecord: 0.3ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +Started GET "/tasks/-1" for 127.0.0.1 at 2019-04-10 22:42:26 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"-1"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] +Completed 404 Not Found in 1ms (ActiveRecord: 0.3ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-10 22:42:26 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (1.3ms) +Completed 200 OK in 5ms (Views: 2.5ms | ActiveRecord: 0.3ms) +  (0.2ms) ROLLBACK +  (1.0ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +Started GET "/" for 127.0.0.1 at 2019-04-10 22:42:26 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (0.8ms) +Completed 200 OK in 3ms (Views: 1.9ms | ActiveRecord: 0.2ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +Started GET "/tasks/new" for 127.0.0.1 at 2019-04-10 22:42:26 -0700 +Processing by TasksController#new as HTML + Rendering tasks/new.html.erb within layouts/application + Rendered tasks/new.html.erb within layouts/application (1.5ms) +Completed 200 OK in 4ms (Views: 2.5ms | ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------- +Task: test_0001_must be valid +----------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (0.2ms) SELECT COUNT(*) FROM "tasks" +Started POST "/tasks" for 127.0.0.1 at 2019-04-10 22:42:26 -0700 +Processing by TasksController#create as HTML + Parameters: {"task"=>{"name"=>"new task", "description"=>"new task description", "completed"=>"false"}} +  (0.2ms) SAVEPOINT active_record_1 + Task Create (0.3ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "new task"], ["description", "new task description"], ["created_at", "2019-04-11 05:42:26.370112"], ["updated_at", "2019-04-11 05:42:26.370112"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://www.example.com/tasks/980190965 +Completed 302 Found in 2ms (ActiveRecord: 0.6ms) +  (0.2ms) SELECT COUNT(*) FROM "tasks" + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."name" = $1 LIMIT $2 [["name", "new task"], ["LIMIT", 1]] +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.1ms) SAVEPOINT active_record_1 + Task Create (0.2ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Stuff"], ["description", "Lots of it!"], ["created_at", "2019-04-11 05:42:26.398498"], ["updated_at", "2019-04-11 05:42:26.398498"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.2ms) SELECT COUNT(*) FROM "tasks" +Started PATCH "/tasks/980190966" for 127.0.0.1 at 2019-04-10 22:42:26 -0700 +Processing by TasksController#update as HTML + Parameters: {"task"=>{"name"=>"new task", "description"=>"new task description", "completed"=>"false"}, "id"=>"980190966"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190966], ["LIMIT", 1]] +  (0.1ms) SAVEPOINT active_record_1 + Task Update (0.2ms) UPDATE "tasks" SET "name" = $1, "description" = $2, "updated_at" = $3 WHERE "tasks"."id" = $4 [["name", "new task"], ["description", "new task description"], ["updated_at", "2019-04-11 05:42:26.402044"], ["id", 980190966]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://www.example.com/tasks/980190966 +Completed 302 Found in 3ms (ActiveRecord: 0.6ms) +  (0.2ms) SELECT COUNT(*) FROM "tasks" + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190966], ["LIMIT", 1]] +  (0.2ms) ROLLBACK +  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC +  (0.2ms) BEGIN +  (0.3ms) ALTER TABLE "tasks" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL +  (0.1ms) COMMIT +  (0.1ms) BEGIN + Fixtures Load (0.5ms) DELETE FROM "tasks"; +INSERT INTO "tasks" ("id", "name", "description", "created_at", "updated_at", "completion_date", "completed") VALUES (980190962, 'MyString', 'MyString', '2019-04-11 05:43:17.630427', '2019-04-11 05:43:17.630427', NULL, DEFAULT), (298486374, 'MyString', 'MyString', '2019-04-11 05:43:17.630427', '2019-04-11 05:43:17.630427', NULL, DEFAULT) +  (1.2ms) COMMIT +  (0.3ms) BEGIN +  (0.2ms) ALTER TABLE "tasks" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL +  (0.2ms) COMMIT +  (0.2ms) BEGIN +----------------------------- +Task: test_0001_must be valid +----------------------------- +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +----------------------------------------------------- +TasksController::show: test_0001_can get a valid task +----------------------------------------------------- +  (0.1ms) SAVEPOINT active_record_1 + Task Create (0.3ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "sample task"], ["description", "this is an example for a test"], ["created_at", "2019-04-11 05:43:17.658111"], ["updated_at", "2019-04-11 05:43:17.658111"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Started GET "/tasks/980190963" for 127.0.0.1 at 2019-04-10 22:43:17 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"980190963"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190963], ["LIMIT", 1]] + Rendering tasks/show.html.erb within layouts/application + Rendered tasks/show.html.erb within layouts/application (1.4ms) +Completed 200 OK in 193ms (Views: 184.6ms | ActiveRecord: 0.3ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------ +TasksController::show: test_0002_will redirect for an invalid task +------------------------------------------------------------------ +Started GET "/tasks/-1" for 127.0.0.1 at 2019-04-10 22:43:17 -0700 +Processing by TasksController#show as HTML + Parameters: {"id"=>"-1"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] +Completed 404 Not Found in 1ms (ActiveRecord: 0.3ms) +  (0.1ms) ROLLBACK +  (0.2ms) BEGIN +--------------------------------------------------------- +TasksController::new: test_0001_can get the new task page +--------------------------------------------------------- +Started GET "/tasks/new" for 127.0.0.1 at 2019-04-10 22:43:17 -0700 +Processing by TasksController#new as HTML + Rendering tasks/new.html.erb within layouts/application + Rendered tasks/new.html.erb within layouts/application (7.9ms) +Completed 200 OK in 20ms (Views: 18.1ms | ActiveRecord: 0.0ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +--------------------------------------------------------------------------- +TasksController::edit: test_0001_can get the edit page for an existing task +--------------------------------------------------------------------------- +  (0.1ms) SAVEPOINT active_record_1 + Task Create (0.3ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "thing"], ["description", "so many things to do!"], ["created_at", "2019-04-11 05:43:17.906398"], ["updated_at", "2019-04-11 05:43:17.906398"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Started GET "/tasks/980190964/edit" for 127.0.0.1 at 2019-04-10 22:43:17 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"980190964"} + Task Load (0.4ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190964], ["LIMIT", 1]] + Rendering tasks/edit.html.erb within layouts/application + Rendered tasks/edit.html.erb within layouts/application (1.9ms) +Completed 200 OK in 15ms (Views: 12.1ms | ActiveRecord: 0.4ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------------------------------------------------------ +TasksController::edit: test_0002_will respond with redirect when attempting to edit a nonexistant task +------------------------------------------------------------------------------------------------------ +Started GET "/tasks/-1/edit" for 127.0.0.1 at 2019-04-10 22:43:17 -0700 +Processing by TasksController#edit as HTML + Parameters: {"id"=>"-1"} + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", -1], ["LIMIT", 1]] +Completed 404 Not Found in 1ms (ActiveRecord: 0.2ms) +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::create: test_0001_can create a new task +-------------------------------------------------------- +  (0.3ms) SELECT COUNT(*) FROM "tasks" +Started POST "/tasks" for 127.0.0.1 at 2019-04-10 22:43:17 -0700 +Processing by TasksController#create as HTML + Parameters: {"task"=>{"name"=>"new task", "description"=>"new task description", "completed"=>"false"}} +  (0.2ms) SAVEPOINT active_record_1 + Task Create (0.2ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "new task"], ["description", "new task description"], ["created_at", "2019-04-11 05:43:17.939752"], ["updated_at", "2019-04-11 05:43:17.939752"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://www.example.com/tasks/980190965 +Completed 302 Found in 2ms (ActiveRecord: 0.5ms) +  (0.3ms) SELECT COUNT(*) FROM "tasks" + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."name" = $1 LIMIT $2 [["name", "new task"], ["LIMIT", 1]] +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +---------------------------------------------------------------------------------------- +TasksController::update: test_0002_will redirect to the root page if given an invalid id +---------------------------------------------------------------------------------------- +  (0.1ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------------- +TasksController::update: test_0001_can update an existing task +-------------------------------------------------------------- +  (0.1ms) SAVEPOINT active_record_1 + Task Create (0.2ms) INSERT INTO "tasks" ("name", "description", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Stuff"], ["description", "Lots of it!"], ["created_at", "2019-04-11 05:43:17.997993"], ["updated_at", "2019-04-11 05:43:17.997993"]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.2ms) SELECT COUNT(*) FROM "tasks" +Started PATCH "/tasks/980190966" for 127.0.0.1 at 2019-04-10 22:43:18 -0700 +Processing by TasksController#update as HTML + Parameters: {"task"=>{"name"=>"new task", "description"=>"new task description", "completed"=>"false"}, "id"=>"980190966"} + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190966], ["LIMIT", 1]] +  (0.2ms) SAVEPOINT active_record_1 + Task Update (0.3ms) UPDATE "tasks" SET "name" = $1, "description" = $2, "updated_at" = $3 WHERE "tasks"."id" = $4 [["name", "new task"], ["description", "new task description"], ["updated_at", "2019-04-11 05:43:18.003531"], ["id", 980190966]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://www.example.com/tasks/980190966 +Completed 302 Found in 12ms (ActiveRecord: 0.9ms) +  (0.4ms) SELECT COUNT(*) FROM "tasks" + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2 [["id", 980190966], ["LIMIT", 1]] +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +------------------------------------------------------- +TasksController::index: test_0002_can get the root path +------------------------------------------------------- +Started GET "/" for 127.0.0.1 at 2019-04-10 22:43:18 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.3ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (1.7ms) +Completed 200 OK in 5ms (Views: 2.9ms | ActiveRecord: 0.3ms) +  (0.2ms) ROLLBACK +  (0.1ms) BEGIN +-------------------------------------------------------- +TasksController::index: test_0001_can get the index path +-------------------------------------------------------- +Started GET "/tasks" for 127.0.0.1 at 2019-04-10 22:43:18 -0700 +Processing by TasksController#index as HTML + Rendering tasks/index.html.erb within layouts/application + Task Load (0.2ms) SELECT "tasks".* FROM "tasks" + Rendered tasks/index.html.erb within layouts/application (0.9ms) +Completed 200 OK in 3ms (Views: 2.1ms | ActiveRecord: 0.2ms) +  (0.2ms) ROLLBACK diff --git a/test/controllers/tasks_controller_test.rb b/test/controllers/tasks_controller_test.rb index 9ee66058a..7d48d3109 100644 --- a/test/controllers/tasks_controller_test.rb +++ b/test/controllers/tasks_controller_test.rb @@ -122,7 +122,7 @@ # Act-Assert expect { - patch edit_task_path(new_task.id), params: task_hash + patch task_path(new_task.id), params: task_hash }.must_change "Task.count", 0 updated_task = Task.find_by(id: new_task.id) @@ -136,7 +136,7 @@ it "will redirect to the root page if given an invalid id" do expect { - edit_task_path(-1) + patch task_path(-1) }.must_redirect_to root_path end end From 713a9422164a0d706ec3397e92df9507f8cd4e35 Mon Sep 17 00:00:00 2001 From: Kimberly-Fasbender Date: Thu, 11 Apr 2019 14:55:22 -0700 Subject: [PATCH 16/34] updated html and css styling because I need practice so I don't die of design anxiety --- app/assets/stylesheets/application.css | 38 +- app/controllers/tasks_controller.rb | 2 +- app/views/layouts/application.html.erb | 9 +- app/views/tasks/edit.html.erb | 1 - app/views/tasks/index.html.erb | 2 +- app/views/tasks/show.html.erb | 2 +- log/development.log | 1171 +++++++++++++++++++++ log/test.log | 278 +++++ test/controllers/tasks_controller_test.rb | 2 +- 9 files changed, 1492 insertions(+), 13 deletions(-) diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index c2f61b0ff..2434bbb42 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -16,28 +16,56 @@ body { background: lightcyan; + height: 100vh; display: grid; grid-template-columns: 1fr 4fr; - grid-template-rows: 700px min-content; + grid-template-rows: 1fr 5fr min-content; margin: 0; } +.app_header { + grid-column: 1 / 3; + grid-row: 1 / 2; + background: lightpink; + font-size: 2em; +} + nav { background: lightgoldenrodyellow; + padding-top: 50px; + display: flex; + flex-direction: column; + align-items: center; grid-column: 1 / 2; - grid-row: 1 / 2; + grid-row: 2 / 3; +} + +.button { + background: lightpink; + width: 100px; + height: 30px; + margin-bottom: 20px; } -main { +.tasks { background: lightcyan; + margin: 50px; grid-column: 2 / 3; - grid-row: 1 / 2; + grid-row: 2 / 3; + border: 2px solid red; + border-radius: 5%; + text-align: center; +} + +.tasks ul { + text-align: left; } footer { background: lightpink; grid-column: 1 / 3; - grid-row: 2 / 3; + grid-row: 3 / 4; + text-align: center; } h1 { diff --git a/app/controllers/tasks_controller.rb b/app/controllers/tasks_controller.rb index ef98ff05a..a7c21f964 100644 --- a/app/controllers/tasks_controller.rb +++ b/app/controllers/tasks_controller.rb @@ -1,6 +1,6 @@ class TasksController < ApplicationController def index - @tasks = Task.all + @tasks = Task.all.order(:name) end def show diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 95293351e..3f7c7dad5 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -10,14 +10,17 @@ -