From 7642903d8829ec89653389bb2d9449fa43564940 Mon Sep 17 00:00:00 2001 From: David Jiang Date: Wed, 10 Aug 2016 11:27:56 -0700 Subject: [PATCH 01/39] add to readme --- .gitignore | 21 +++ Gemfile | 48 +++++ Gemfile.lock | 175 ++++++++++++++++++ README.md | 12 ++ 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/stylesheets/application.css | 15 ++ app/channels/application_cable/channel.rb | 4 + app/channels/application_cable/connection.rb | 4 + app/controllers/application_controller.rb | 3 + app/controllers/concerns/.keep | 0 app/helpers/application_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 | 14 ++ 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 | 34 ++++ bin/spring | 15 ++ bin/update | 29 +++ config.ru | 5 + config/application.rb | 15 ++ config/boot.rb | 3 + config/cable.yml | 9 + config/database.yml | 25 +++ config/environment.rb | 5 + config/environments/development.rb | 54 ++++++ config/environments/production.rb | 86 +++++++++ config/environments/test.rb | 42 +++++ .../application_controller_renderer.rb | 6 + config/initializers/assets.rb | 11 ++ config/initializers/backtrace_silencers.rb | 7 + 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/new_framework_defaults.rb | 24 +++ config/initializers/session_store.rb | 3 + config/initializers/wrap_parameters.rb | 14 ++ config/locales/en.yml | 23 +++ config/puma.rb | 47 +++++ config/routes.rb | 3 + config/secrets.yml | 22 +++ config/spring.rb | 6 + db/seeds.rb | 7 + lib/assets/.keep | 0 lib/tasks/.keep | 0 log/.keep | 0 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 | 5 + test/controllers/.keep | 0 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/test_helper.rb | 10 + tmp/.keep | 0 vendor/assets/javascripts/.keep | 0 vendor/assets/stylesheets/.keep | 0 75 files changed, 1119 insertions(+) create mode 100644 .gitignore create mode 100644 Gemfile create mode 100644 Gemfile.lock create mode 100644 README.md 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/stylesheets/application.css 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/helpers/application_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 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/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/application_controller_renderer.rb create mode 100644 config/initializers/assets.rb create mode 100644 config/initializers/backtrace_silencers.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/new_framework_defaults.rb create mode 100644 config/initializers/session_store.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/secrets.yml create mode 100644 config/spring.rb 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 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 test/controllers/.keep 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/test_helper.rb create mode 100644 tmp/.keep create mode 100644 vendor/assets/javascripts/.keep create mode 100644 vendor/assets/stylesheets/.keep diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..bab620de0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,21 @@ +# See https://help.github.com/articles/ignoring-files for more about ignoring files. +# +# If you find yourself ignoring temporary files generated by your text editor +# or operating system, you probably want to add a global ignore instead: +# git config --global core.excludesfile '~/.gitignore_global' + +# Ignore bundler config. +/.bundle + +# Ignore the default SQLite database. +/db/*.sqlite3 +/db/*.sqlite3-journal + +# Ignore all logfiles and tempfiles. +/log/* +/tmp/* +!/log/.keep +!/tmp/.keep + +# Ignore Byebug command history file. +.byebug_history diff --git a/Gemfile b/Gemfile new file mode 100644 index 000000000..0447f7094 --- /dev/null +++ b/Gemfile @@ -0,0 +1,48 @@ +source 'https://rubygems.org' + + +# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' +gem 'rails', '~> 5.0.0' +# Use sqlite3 as the database for Active Record +gem 'sqlite3' +# Use Puma as the app server +gem 'puma', '~> 3.0' +# Use SCSS for stylesheets +gem 'sass-rails', '~> 5.0' +# Use Uglifier as compressor for JavaScript assets +gem 'uglifier', '>= 1.3.0' +# Use CoffeeScript for .coffee assets and views +gem 'coffee-rails', '~> 4.2' +# See https://github.com/rails/execjs#readme for more supported runtimes +# gem 'therubyracer', platforms: :ruby + +# Use jquery as the JavaScript library +gem 'jquery-rails' +# 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', '~> 3.0' +# Use ActiveModel has_secure_password +# gem 'bcrypt', '~> 3.1.7' + +# Use Capistrano for deployment +# gem 'capistrano-rails', group: :development + +group :development, :test do + # Call 'byebug' anywhere in the code to stop execution and get a debugger console + gem 'byebug', platform: :mri +end + +group :development do + # Access an IRB console on exception pages or by using <%= console %> anywhere in the code. + gem 'web-console' + gem 'listen', '~> 3.0.5' + # 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 + +# Windows does not include zoneinfo files, so bundle the tzinfo-data gem +gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 000000000..200d65bca --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,175 @@ +GEM + remote: https://rubygems.org/ + specs: + actioncable (5.0.0) + actionpack (= 5.0.0) + nio4r (~> 1.2) + websocket-driver (~> 0.6.1) + actionmailer (5.0.0) + actionpack (= 5.0.0) + actionview (= 5.0.0) + activejob (= 5.0.0) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 2.0) + actionpack (5.0.0) + actionview (= 5.0.0) + activesupport (= 5.0.0) + rack (~> 2.0) + rack-test (~> 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionview (5.0.0) + activesupport (= 5.0.0) + builder (~> 3.1) + erubis (~> 2.7.0) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + activejob (5.0.0) + activesupport (= 5.0.0) + globalid (>= 0.3.6) + activemodel (5.0.0) + activesupport (= 5.0.0) + activerecord (5.0.0) + activemodel (= 5.0.0) + activesupport (= 5.0.0) + arel (~> 7.0) + activesupport (5.0.0) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (~> 0.7) + minitest (~> 5.1) + tzinfo (~> 1.1) + arel (7.1.1) + builder (3.2.2) + byebug (9.0.5) + coffee-rails (4.2.1) + coffee-script (>= 2.2.0) + railties (>= 4.0.0, < 5.2.x) + coffee-script (2.4.1) + coffee-script-source + execjs + coffee-script-source (1.10.0) + concurrent-ruby (1.0.2) + debug_inspector (0.0.2) + erubis (2.7.0) + execjs (2.7.0) + ffi (1.9.14) + globalid (0.3.7) + activesupport (>= 4.1.0) + i18n (0.7.0) + jbuilder (2.6.0) + activesupport (>= 3.0.0, < 5.1) + multi_json (~> 1.2) + jquery-rails (4.1.1) + rails-dom-testing (>= 1, < 3) + railties (>= 4.2.0) + thor (>= 0.14, < 2.0) + listen (3.0.8) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + loofah (2.0.3) + nokogiri (>= 1.5.9) + mail (2.6.4) + mime-types (>= 1.16, < 4) + method_source (0.8.2) + mime-types (3.1) + mime-types-data (~> 3.2015) + mime-types-data (3.2016.0521) + mini_portile2 (2.1.0) + minitest (5.9.0) + multi_json (1.12.1) + nio4r (1.2.1) + nokogiri (1.6.8) + mini_portile2 (~> 2.1.0) + pkg-config (~> 1.1.7) + pkg-config (1.1.7) + puma (3.6.0) + rack (2.0.1) + rack-test (0.6.3) + rack (>= 1.0) + rails (5.0.0) + actioncable (= 5.0.0) + actionmailer (= 5.0.0) + actionpack (= 5.0.0) + actionview (= 5.0.0) + activejob (= 5.0.0) + activemodel (= 5.0.0) + activerecord (= 5.0.0) + activesupport (= 5.0.0) + bundler (>= 1.3.0, < 2.0) + railties (= 5.0.0) + sprockets-rails (>= 2.0.0) + rails-dom-testing (2.0.1) + activesupport (>= 4.2.0, < 6.0) + nokogiri (~> 1.6.0) + rails-html-sanitizer (1.0.3) + loofah (~> 2.0) + railties (5.0.0) + actionpack (= 5.0.0) + activesupport (= 5.0.0) + method_source + rake (>= 0.8.7) + thor (>= 0.18.1, < 2.0) + rake (11.2.2) + rb-fsevent (0.9.7) + rb-inotify (0.9.7) + ffi (>= 0.5.0) + sass (3.4.22) + sass-rails (5.0.6) + railties (>= 4.0.0, < 6) + sass (~> 3.1) + sprockets (>= 2.8, < 4.0) + sprockets-rails (>= 2.0, < 4.0) + tilt (>= 1.1, < 3) + spring (1.7.2) + spring-watcher-listen (2.0.0) + listen (>= 2.7, < 4.0) + spring (~> 1.2) + sprockets (3.7.0) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.1.1) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + sqlite3 (1.3.11) + thor (0.19.1) + thread_safe (0.3.5) + tilt (2.0.5) + turbolinks (5.0.1) + turbolinks-source (~> 5) + turbolinks-source (5.0.0) + tzinfo (1.2.2) + thread_safe (~> 0.1) + uglifier (3.0.1) + execjs (>= 0.3.0, < 3) + web-console (3.3.1) + actionview (>= 5.0) + activemodel (>= 5.0) + debug_inspector + railties (>= 5.0) + websocket-driver (0.6.4) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.2) + +PLATFORMS + ruby + +DEPENDENCIES + byebug + coffee-rails (~> 4.2) + jbuilder (~> 2.5) + jquery-rails + listen (~> 3.0.5) + puma (~> 3.0) + rails (~> 5.0.0) + sass-rails (~> 5.0) + spring + spring-watcher-listen (~> 2.0.0) + sqlite3 + turbolinks (~> 5) + tzinfo-data + uglifier (>= 1.3.0) + web-console + +BUNDLED WITH + 1.12.5 diff --git a/README.md b/README.md new file mode 100644 index 000000000..aa516c53e --- /dev/null +++ b/README.md @@ -0,0 +1,12 @@ + +# README + +Danebook +======== + +[David Jiang](https://github.com/davidmjiang) + +A project for [Viking Code School](http://vikingcodeschool.com) + + + 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..b12018d09 --- /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, vendor/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 jquery +//= require jquery_ujs +//= require turbolinks +//= require_tree . diff --git a/app/assets/javascripts/cable.js b/app/assets/javascripts/cable.js new file mode 100644 index 000000000..71ee1e66d --- /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/stylesheets/application.css b/app/assets/stylesheets/application.css new file mode 100644 index 000000000..0ebd7fe82 --- /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, vendor/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/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..1c07694e9 --- /dev/null +++ b/app/controllers/application_controller.rb @@ -0,0 +1,3 @@ +class ApplicationController < ActionController::Base + protect_from_forgery with: :exception +end diff --git a/app/controllers/concerns/.keep b/app/controllers/concerns/.keep new file mode 100644 index 000000000..e69de29bb 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/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..ba857f157 --- /dev/null +++ b/app/views/layouts/application.html.erb @@ -0,0 +1,14 @@ + + + + Danebook + <%= csrf_meta_tags %> + + <%= 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..66e9889e8 --- /dev/null +++ b/bin/bundle @@ -0,0 +1,3 @@ +#!/usr/bin/env ruby +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) +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..e620b4dad --- /dev/null +++ b/bin/setup @@ -0,0 +1,34 @@ +#!/usr/bin/env ruby +require 'pathname' +require 'fileutils' +include FileUtils + +# path to your application root. +APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) + +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') + + # 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..7fe232c3a --- /dev/null +++ b/bin/spring @@ -0,0 +1,15 @@ +#!/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' + + if (match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m)) + Gem.paths = { 'GEM_PATH' => [Bundler.bundle_path.to_s, *Gem.path].uniq.join(Gem.path_separator) } + gem 'spring', match[1] + require 'spring/binstub' + end +end diff --git a/bin/update b/bin/update new file mode 100755 index 000000000..a8e4462f2 --- /dev/null +++ b/bin/update @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +require 'pathname' +require 'fileutils' +include FileUtils + +# path to your application root. +APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) + +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') + + 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/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..f13c54c98 --- /dev/null +++ b/config/application.rb @@ -0,0 +1,15 @@ +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 Danebook + class Application < Rails::Application + # Settings in config/environments/* take precedence over those specified here. + # Application configuration should go into files in config/initializers + # -- all .rb files in that directory are automatically loaded. + end +end diff --git a/config/boot.rb b/config/boot.rb new file mode 100644 index 000000000..30f5120df --- /dev/null +++ b/config/boot.rb @@ -0,0 +1,3 @@ +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) + +require 'bundler/setup' # Set up gems listed in the Gemfile. diff --git a/config/cable.yml b/config/cable.yml new file mode 100644 index 000000000..0bbde6f74 --- /dev/null +++ b/config/cable.yml @@ -0,0 +1,9 @@ +development: + adapter: async + +test: + adapter: async + +production: + adapter: redis + url: redis://localhost:6379/1 diff --git a/config/database.yml b/config/database.yml new file mode 100644 index 000000000..1c1a37ca8 --- /dev/null +++ b/config/database.yml @@ -0,0 +1,25 @@ +# SQLite version 3.x +# gem install sqlite3 +# +# Ensure the SQLite 3 gem is defined in your Gemfile +# gem 'sqlite3' +# +default: &default + adapter: sqlite3 + pool: 5 + timeout: 5000 + +development: + <<: *default + database: db/development.sqlite3 + +# 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: db/test.sqlite3 + +production: + <<: *default + database: db/production.sqlite3 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..6f7197045 --- /dev/null +++ b/config/environments/development.rb @@ -0,0 +1,54 @@ +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. + 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=172800' + } + else + config.action_controller.perform_caching = false + + config.cache_store = :null_store + end + + # 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 + + # 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..e43500ee1 --- /dev/null +++ b/config/environments/production.rb @@ -0,0 +1,86 @@ +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 + + # 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 + + # 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 = "danebook_#{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..30587ef6d --- /dev/null +++ b/config/environments/test.rb @@ -0,0 +1,42 @@ +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=3600' + } + + # 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 + 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/application_controller_renderer.rb b/config/initializers/application_controller_renderer.rb new file mode 100644 index 000000000..51639b67a --- /dev/null +++ b/config/initializers/application_controller_renderer.rb @@ -0,0 +1,6 @@ +# Be sure to restart your server when you modify this file. + +# ApplicationController.renderer.defaults.merge!( +# http_host: 'example.org', +# https: false +# ) diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb new file mode 100644 index 000000000..01ef3e663 --- /dev/null +++ b/config/initializers/assets.rb @@ -0,0 +1,11 @@ +# 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 + +# Precompile additional assets. +# application.js, application.css, and all non-JS/CSS in app/assets folder are already added. +# Rails.application.config.assets.precompile += %w( search.js ) 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/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/new_framework_defaults.rb b/config/initializers/new_framework_defaults.rb new file mode 100644 index 000000000..0706cafd4 --- /dev/null +++ b/config/initializers/new_framework_defaults.rb @@ -0,0 +1,24 @@ +# Be sure to restart your server when you modify this file. +# +# This file contains migration options to ease your Rails 5.0 upgrade. +# +# Read the Rails 5.0 release notes for more info on each option. + +# Enable per-form CSRF tokens. Previous versions had false. +Rails.application.config.action_controller.per_form_csrf_tokens = true + +# Enable origin-checking CSRF mitigation. Previous versions had false. +Rails.application.config.action_controller.forgery_protection_origin_check = true + +# Make Ruby 2.4 preserve the timezone of the receiver when calling `to_time`. +# Previous versions had false. +ActiveSupport.to_time_preserves_timezone = true + +# Require `belongs_to` associations by default. Previous versions had false. +Rails.application.config.active_record.belongs_to_required_by_default = true + +# Do not halt callback chains when a callback returns false. Previous versions had true. +ActiveSupport.halt_callback_chains_on_return_false = false + +# Configure SSL options to enable HSTS with subdomains. Previous versions had false. +Rails.application.config.ssl_options = { hsts: { subdomains: true } } diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb new file mode 100644 index 000000000..f7b5ca3e4 --- /dev/null +++ b/config/initializers/session_store.rb @@ -0,0 +1,3 @@ +# Be sure to restart your server when you modify this file. + +Rails.application.config.session_store :cookie_store, key: '_danebook_session' 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..065395716 --- /dev/null +++ b/config/locales/en.yml @@ -0,0 +1,23 @@ +# 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. +# +# 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..c7f311f81 --- /dev/null +++ b/config/puma.rb @@ -0,0 +1,47 @@ +# 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 }.to_i +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. If you use this option +# you need to make sure to reconnect any threads in the `on_worker_boot` +# block. +# +# preload_app! + +# The code in the `on_worker_boot` will be called if you are using +# clustered mode by specifying a number of `workers`. After each worker +# process is booted this block will be run, if you are using `preload_app!` +# option you will want to use this block to reconnect to any threads +# or connections that may have been created at application boot, Ruby +# cannot share connections between processes. +# +# on_worker_boot do +# ActiveRecord::Base.establish_connection if defined?(ActiveRecord) +# end + +# 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/secrets.yml b/config/secrets.yml new file mode 100644 index 000000000..1af36da5d --- /dev/null +++ b/config/secrets.yml @@ -0,0 +1,22 @@ +# Be sure to restart your server when you modify this file. + +# Your secret key is used for verifying the integrity of signed cookies. +# If you change this key, all old signed cookies will become invalid! + +# Make sure the secret is at least 30 characters and all random, +# no regular words or you'll be exposed to dictionary attacks. +# You can use `rails secret` to generate a secure secret key. + +# Make sure the secrets in this file are kept private +# if you're sharing your code publicly. + +development: + secret_key_base: f440b79111f00fbaabf242f3af5457e16d82366e6a5b53398b9bd45897158662406598666e948babbe23a063c08dbac135d2bdbbf1e11d7170feac5b927a4929 + +test: + secret_key_base: 9365fec3b5678a9ffdc65fbcac9b1dcc8aad2856876f2067ce67bb3eb189e1d8353adafabe895b6f3febe45369acc2165e904ca5601fcb4b95d72d0cb49ab12f + +# Do not keep production secrets in the repository, +# instead read values from the environment. +production: + secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> diff --git a/config/spring.rb b/config/spring.rb new file mode 100644 index 000000000..c9119b40c --- /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/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/public/404.html b/public/404.html new file mode 100644 index 000000000..b612547fc --- /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..a21f82b3b --- /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..061abc587 --- /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..3c9c7c01f --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,5 @@ +# See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file +# +# To ban all spiders from the entire site uncomment the next two lines: +# User-agent: * +# Disallow: / diff --git a/test/controllers/.keep b/test/controllers/.keep new file mode 100644 index 000000000..e69de29bb 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/test_helper.rb b/test/test_helper.rb new file mode 100644 index 000000000..92e39b2d7 --- /dev/null +++ b/test/test_helper.rb @@ -0,0 +1,10 @@ +ENV['RAILS_ENV'] ||= 'test' +require File.expand_path('../../config/environment', __FILE__) +require 'rails/test_help' + +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/tmp/.keep b/tmp/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/vendor/assets/javascripts/.keep b/vendor/assets/javascripts/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/vendor/assets/stylesheets/.keep b/vendor/assets/stylesheets/.keep new file mode 100644 index 000000000..e69de29bb From 0ab0d8bb3c8ace0812f2363d87100b309824c2d1 Mon Sep 17 00:00:00 2001 From: David Jiang Date: Wed, 10 Aug 2016 11:51:51 -0700 Subject: [PATCH 02/39] homepage added --- app/assets/javascripts/static_pages.coffee | 3 + app/assets/static_pages.css.scss | 342 +++++++++++++++++ app/assets/stylesheets/static_pages.scss | 345 ++++++++++++++++++ app/controllers/static_pages_controller.rb | 4 + app/helpers/static_pages_helper.rb | 2 + app/views/layouts/application.html.erb | 9 +- app/views/static_pages/home.html.erb | 155 ++++++++ config/routes.rb | 1 + .../static_pages_controller_test.rb | 7 + 9 files changed, 867 insertions(+), 1 deletion(-) create mode 100644 app/assets/javascripts/static_pages.coffee create mode 100644 app/assets/static_pages.css.scss create mode 100644 app/assets/stylesheets/static_pages.scss create mode 100644 app/controllers/static_pages_controller.rb create mode 100644 app/helpers/static_pages_helper.rb create mode 100644 app/views/static_pages/home.html.erb create mode 100644 test/controllers/static_pages_controller_test.rb diff --git a/app/assets/javascripts/static_pages.coffee b/app/assets/javascripts/static_pages.coffee new file mode 100644 index 000000000..24f83d18b --- /dev/null +++ b/app/assets/javascripts/static_pages.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/static_pages.css.scss b/app/assets/static_pages.css.scss new file mode 100644 index 000000000..e8ab88262 --- /dev/null +++ b/app/assets/static_pages.css.scss @@ -0,0 +1,342 @@ +body { + font-family: 'Nunito',sans-serif; +} + +.about-page { + padding-top: 50px; +} + +.header-bar { + background-color: #3b5998; +} + +.navbar-default .big-logo { + color: white; + font-size: 48px; + margin: 10px; +} + +.header-label { + color: white; +} + +.header-input { + border: 2px solid black; + border-radius: 0; +} + +.header-submit { + background-color: #39f; + border-radius: 0; + border-color: black; + margin-top: 17px; +} + +.teaser { + margin-top: 50px; + line-height: 3; +} + +.teaser li { + color: #666; + font-size: 18px; +} + +.teaser span { + font-weight: bold; +} + +.sign-up-form { + margin-top: 10px; + width: 100%; +} + +.gender { + margin-top: 10px; +} + +.sign-up-btn { + margin-top: 10px; + font-size: 20px; + width: 100%; +} + +.search-bar { + width: 100%; +} +.search-bar .search-bar { + width: 100%; +} + +#flag { + height: 100%; +} + +#brand-link { + padding: 0; +} + +#user-name, #title-text { + color: white; +} + +#search-field { + margin-left: -50px; + margin-right: 50px; +} + +.cover-photo { + text-align: center; + position: relative; +} + +#profile-pic { + position: absolute; + bottom: -5%; + left: 12%; +} + +#profile-name { + position: absolute; + bottom: 0; + left: 33%; + color: white; +} + +#about-user-name { + color: white; + font-size: 25px; +} + +.menu-bar { + border: 1px solid black; +} + +.about-header div { + text-align: center; + font-size: 24px; + background-color: #ddd; +} + +.edit-button { + background-color: #39f; + border-radius: 0; + border-color: black; + color: white; + float: right; +} + +.about-container { + border: 2px solid black; + margin-top: 10px; +} + +#text-description { + padding-right: 5%; +} + +#information { + padding-left: 5%; +} + +#save_changes { + width: 50%; +} + +.post-box { + border: 2px solid black; + margin-top: 40px; +} + +.centered-text { + text-align: center; +} + +.post-title { + border-bottom: 2px solid black; + background-color: #e6e6e6; + margin-top: 0; +} + +.post-button-container { + border-top: 2px solid black; + background-color: #e6e6e6; + padding: 3px; + text-align: right; +} + +/* these are from the old file. may need media queries*/ +.small-image { + width: 58px; + height: 54px; +} + +.side-image { + display: inline-block; + margin: 2px 0px 0px 2px; + border: 1px solid black; +} + +.small-text { + margin: 18px 15px; +} + +.side-text { + display: inline-block; +} +.side-text p { + font-size: 12px; +} + +.post-date { + color: gray; +} + +.post-text { + padding: 10px; + font-size: 12px; +} + +.like-comment-container { + font-size: 12px; + line-height: 20px; + background-color: #e6e6e6; + padding: 3px; +} + +.comment-border { + border-top: 2px solid black; +} + +.post-reaction { + margin-left: 10px; +} + +.delete { + float: right; + margin-right: 10px; +} + +.clear { + clear: both; +} + +.reaction-text { + margin-left: 10px; + color: gray; +} + +.comment-border-grey { + border-top: 2px solid gray; +} + +.comment-format { + display: inline-block; +} + +.comment-text { + margin-left: 65px; + border: none; +} + +.comment-form { + text-align: center; +} + +.comment-button-container { + text-align: right; +} + +.left { + float: left; +} + +.box-border { + border: 2px solid black; + margin-top: 10px; +} + +.box-header { + background-color: #e6e6e6; + border-bottom: 2px solid black; +} + +.box-title { + margin-top: 10px; +} + +.wrap-text { + white-space: normal; +} + +.friend-image { + display: inline-block; + margin: 4px; + width: 90px; + height: 90px; + background: white; + border: 1px solid black; +} + +.friend-name { + display: inline-block; + margin-left: 10px; +} + +.stats { + color: gray; +} + +.unfriend { + background-color: #e6e6e6; + margin: 0px 20px; +} + +.friend-box { + border: 2px solid black; + margin-top: 10px; +} + +.friends-main { + border: 2px solid black; + margin-top: 10px; + padding: 0 15px 10px; +} + +.friend-container { + border: 2px solid black; + margin-top: 10px; +} + +.friend-header { + text-align: center; + font-size: 24px; + background-color: #ddd; + margin-bottom: 10px; + border-bottom: 2px solid black; +} + +.thumbnail { + position: relative; +} + +.hover-text { + background: rgba(0, 0, 0, 0.5); + color: white; + position: absolute; + bottom: 0; + left: 0; + width: 100%; + text-align: center; + opacity: 0; + -webkit-transition: opacity 500ms; + -moz-transition: opacity 500ms; + -o-transition: opacity 500ms; + transition: opacity 500ms; +} + +.thumbnail:hover .hover-text { + opacity: 1; +} + +/*# sourceMappingURL=styles.css.map */ diff --git a/app/assets/stylesheets/static_pages.scss b/app/assets/stylesheets/static_pages.scss new file mode 100644 index 000000000..67bddc63e --- /dev/null +++ b/app/assets/stylesheets/static_pages.scss @@ -0,0 +1,345 @@ +// Place all the styles related to the static_pages controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ +body { + font-family: 'Nunito',sans-serif; +} + +.about-page { + padding-top: 50px; +} + +.header-bar { + background-color: #3b5998; +} + +.navbar-default .big-logo { + color: white; + font-size: 48px; + margin: 10px; +} + +.header-label { + color: white; +} + +.header-input { + border: 2px solid black; + border-radius: 0; +} + +.header-submit { + background-color: #39f; + border-radius: 0; + border-color: black; + margin-top: 17px; +} + +.teaser { + margin-top: 50px; + line-height: 3; +} + +.teaser li { + color: #666; + font-size: 18px; +} + +.teaser span { + font-weight: bold; +} + +.sign-up-form { + margin-top: 10px; + width: 100%; +} + +.gender { + margin-top: 10px; +} + +.sign-up-btn { + margin-top: 10px; + font-size: 20px; + width: 100%; +} + +.search-bar { + width: 100%; +} +.search-bar .search-bar { + width: 100%; +} + +#flag { + height: 100%; +} + +#brand-link { + padding: 0; +} + +#user-name, #title-text { + color: white; +} + +#search-field { + margin-left: -50px; + margin-right: 50px; +} + +.cover-photo { + text-align: center; + position: relative; +} + +#profile-pic { + position: absolute; + bottom: -5%; + left: 12%; +} + +#profile-name { + position: absolute; + bottom: 0; + left: 33%; + color: white; +} + +#about-user-name { + color: white; + font-size: 25px; +} + +.menu-bar { + border: 1px solid black; +} + +.about-header div { + text-align: center; + font-size: 24px; + background-color: #ddd; +} + +.edit-button { + background-color: #39f; + border-radius: 0; + border-color: black; + color: white; + float: right; +} + +.about-container { + border: 2px solid black; + margin-top: 10px; +} + +#text-description { + padding-right: 5%; +} + +#information { + padding-left: 5%; +} + +#save_changes { + width: 50%; +} + +.post-box { + border: 2px solid black; + margin-top: 40px; +} + +.centered-text { + text-align: center; +} + +.post-title { + border-bottom: 2px solid black; + background-color: #e6e6e6; + margin-top: 0; +} + +.post-button-container { + border-top: 2px solid black; + background-color: #e6e6e6; + padding: 3px; + text-align: right; +} + +/* these are from the old file. may need media queries*/ +.small-image { + width: 58px; + height: 54px; +} + +.side-image { + display: inline-block; + margin: 2px 0px 0px 2px; + border: 1px solid black; +} + +.small-text { + margin: 18px 15px; +} + +.side-text { + display: inline-block; +} +.side-text p { + font-size: 12px; +} + +.post-date { + color: gray; +} + +.post-text { + padding: 10px; + font-size: 12px; +} + +.like-comment-container { + font-size: 12px; + line-height: 20px; + background-color: #e6e6e6; + padding: 3px; +} + +.comment-border { + border-top: 2px solid black; +} + +.post-reaction { + margin-left: 10px; +} + +.delete { + float: right; + margin-right: 10px; +} + +.clear { + clear: both; +} + +.reaction-text { + margin-left: 10px; + color: gray; +} + +.comment-border-grey { + border-top: 2px solid gray; +} + +.comment-format { + display: inline-block; +} + +.comment-text { + margin-left: 65px; + border: none; +} + +.comment-form { + text-align: center; +} + +.comment-button-container { + text-align: right; +} + +.left { + float: left; +} + +.box-border { + border: 2px solid black; + margin-top: 10px; +} + +.box-header { + background-color: #e6e6e6; + border-bottom: 2px solid black; +} + +.box-title { + margin-top: 10px; +} + +.wrap-text { + white-space: normal; +} + +.friend-image { + display: inline-block; + margin: 4px; + width: 90px; + height: 90px; + background: white; + border: 1px solid black; +} + +.friend-name { + display: inline-block; + margin-left: 10px; +} + +.stats { + color: gray; +} + +.unfriend { + background-color: #e6e6e6; + margin: 0px 20px; +} + +.friend-box { + border: 2px solid black; + margin-top: 10px; +} + +.friends-main { + border: 2px solid black; + margin-top: 10px; + padding: 0 15px 10px; +} + +.friend-container { + border: 2px solid black; + margin-top: 10px; +} + +.friend-header { + text-align: center; + font-size: 24px; + background-color: #ddd; + margin-bottom: 10px; + border-bottom: 2px solid black; +} + +.thumbnail { + position: relative; +} + +.hover-text { + background: rgba(0, 0, 0, 0.5); + color: white; + position: absolute; + bottom: 0; + left: 0; + width: 100%; + text-align: center; + opacity: 0; + -webkit-transition: opacity 500ms; + -moz-transition: opacity 500ms; + -o-transition: opacity 500ms; + transition: opacity 500ms; +} + +.thumbnail:hover .hover-text { + opacity: 1; +} + +/*# sourceMappingURL=styles.css.map */ diff --git a/app/controllers/static_pages_controller.rb b/app/controllers/static_pages_controller.rb new file mode 100644 index 000000000..cf48a8bb3 --- /dev/null +++ b/app/controllers/static_pages_controller.rb @@ -0,0 +1,4 @@ +class StaticPagesController < ApplicationController + def home + end +end diff --git a/app/helpers/static_pages_helper.rb b/app/helpers/static_pages_helper.rb new file mode 100644 index 000000000..2d63e79e6 --- /dev/null +++ b/app/helpers/static_pages_helper.rb @@ -0,0 +1,2 @@ +module StaticPagesHelper +end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index ba857f157..993b35a2b 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -3,7 +3,14 @@ Danebook <%= csrf_meta_tags %> - + + + + + + + + <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %> diff --git a/app/views/static_pages/home.html.erb b/app/views/static_pages/home.html.erb new file mode 100644 index 000000000..8f846e513 --- /dev/null +++ b/app/views/static_pages/home.html.erb @@ -0,0 +1,155 @@ + + + +
+
+ +
+

Connect with all your friends!

+
    +
  • See photos and updates in your news feed
  • +
  • Post your status for the world to see from your profile
  • +
  • Get in touch with your friends by "friending" them
  • +
  • Like things because you're a positive person!
  • +
+
+ +
+

Sign Up

+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+

Birthday

+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ Female +
+
+ Male +
+
+ +
+
+
+
+ + \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 787824f88..78a6b688f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,3 +1,4 @@ Rails.application.routes.draw do + root "static_pages#home" # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html end diff --git a/test/controllers/static_pages_controller_test.rb b/test/controllers/static_pages_controller_test.rb new file mode 100644 index 000000000..76b4b38eb --- /dev/null +++ b/test/controllers/static_pages_controller_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class StaticPagesControllerTest < ActionDispatch::IntegrationTest + # test "the truth" do + # assert true + # end +end From 813e896759c8e28fea7c9066cb3742e0b8cc7f71 Mon Sep 17 00:00:00 2001 From: David Jiang Date: Wed, 10 Aug 2016 14:32:15 -0700 Subject: [PATCH 03/39] added pages and links --- app/assets/images/danish_flag.gif | Bin 0 -> 2268 bytes app/assets/images/harry_potter_small.jpg | Bin 0 -> 12773 bytes app/assets/images/hogwarts_small.jpg | Bin 0 -> 73659 bytes app/assets/images/icon_photo_small.png | Bin 0 -> 7321 bytes app/assets/images/wizard_hat.png | Bin 0 -> 21588 bytes app/controllers/static_pages_controller.rb | 15 ++ .../static_pages/_homepage_navbar.html.erb | 29 +++ app/views/static_pages/_main_nav.html.erb | 29 +++ app/views/static_pages/_middle_nav.html.erb | 18 ++ app/views/static_pages/about.html.erb | 85 +++++++ app/views/static_pages/about_edit.html.erb | 86 +++++++ app/views/static_pages/friends.html.erb | 100 +++++++++ app/views/static_pages/home.html.erb | 29 +-- app/views/static_pages/photos.html.erb | 93 ++++++++ app/views/static_pages/timeline.html.erb | 212 ++++++++++++++++++ config/routes.rb | 5 + 16 files changed, 673 insertions(+), 28 deletions(-) create mode 100644 app/assets/images/danish_flag.gif create mode 100644 app/assets/images/harry_potter_small.jpg create mode 100644 app/assets/images/hogwarts_small.jpg create mode 100644 app/assets/images/icon_photo_small.png create mode 100644 app/assets/images/wizard_hat.png create mode 100644 app/views/static_pages/_homepage_navbar.html.erb create mode 100644 app/views/static_pages/_main_nav.html.erb create mode 100644 app/views/static_pages/_middle_nav.html.erb create mode 100644 app/views/static_pages/about.html.erb create mode 100644 app/views/static_pages/about_edit.html.erb create mode 100644 app/views/static_pages/friends.html.erb create mode 100644 app/views/static_pages/photos.html.erb create mode 100644 app/views/static_pages/timeline.html.erb diff --git a/app/assets/images/danish_flag.gif b/app/assets/images/danish_flag.gif new file mode 100644 index 0000000000000000000000000000000000000000..132d8cff8a645f566b9d1c8c25adc571f653d830 GIT binary patch literal 2268 zcmV<22qX7LNk%w1VXpxo0mJ|RN*pBc#LUu9W|5DOavCYf$jDh&SCEg7RY*%tD={n{ zAvPT%^V8URH$&v)Qp>z@TtQEEG-_9{XP5te`$MzgoTEOhjvYfjE#JNkda}6j+K^|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+9?$&q&_^%5B+gH7{q@)@Uw!u6cklh|+kY?q_~dgQe);I9 zuf9R&ukZf*@cYqz{Pfqq{`~gmuYdRW@9+Qr&+8um2S~u+39x_&Od$A7r@#g}@OBJ* zpadtFx&u=1f*ACQ1vALO4tisQ9t@!fApyb>n(%~SC?N`07(x}Y@P!z3Aq;2uKpE2T zh6uDF4tMxJ9rEyp_VXbShxk4r67h)WGa?d~_&p^u@rl@TA{3_>Jt0w{1coFZNx%t6;Vb^G*%Tw z#6?+^(ThC)^qCzs#70jQ(n5?>R3#Vc+{vS}W0>L{J2 z;DIIv4D51`QsDv`A9FY1arOE`TwR9>Rn5rkKzJaQBvZ@=f3MZ|0MO`p8rB`(U zRalO74P0H*S=EqMGp%(fWsNC2Jrq~5&J{&<4dq+8(AF^Rbqjsv(qFX@*eeZ|DS74O zVX;tHDJ}L2jcw9ntq@rxO|~j8eWx2PONGh~iL+DitdBq|1<~e+v{5iEjZg~()xLss6T q*0|2Ku6NDrUi0RTI^bbqA) literal 0 HcmV?d00001 diff --git a/app/assets/images/harry_potter_small.jpg b/app/assets/images/harry_potter_small.jpg new file mode 100644 index 0000000000000000000000000000000000000000..3d660d77d5774558ed2514cb52ef4972e34aab36 GIT binary patch literal 12773 zcmbW61z1$y*YD2+-7p~CHADB%-O?qY0z-ErARX$6bVv$Fmm(c1NT-052uKPDk^&+K zcliJA{r&#;eV+Hd?|t_?&zaAxz4kf#yVgE?)|t7UyIuxJwbV4#01yZSWME#v^(x^V zO=ac#`i6RHnzvOk9RNV6aogF$6HE#K?jC+VhU!Ypcg!uAamD~JfCpd$LI7Zc^7Ya& zQZoiHO;c5w*%#w~Cf%=<5&zgXdh?c6==Fg`bP_Of%gyWt)TKMwG> z$1vnJhT{U9?E^79g<*C#e|KjL|H3fL-QLC*0HB07c0YTR6NUvbOz2~5sElD50Kg@5 z{5Q7!H}7XScB3;;BJ{5L&RH|xd8&(BLrKp-$Mkl)!J z#eWmfzuW)Q;cw6X9RBTk{5RM8J9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{_HSCiDzEfezXu$4 zh*lgtEfwl?NLvpqHkwJxh9V?})Ymi$>K(@?CPWq{m|$^>{q+y80cF!{(#wi9no7rg z+P7}Lj0C>uu~PJg!qeTV?@m?sR9-B>j6?K8{4M@l&fH|e6wq3zON3LyyrV##tbqIu z4~5f}ttk*MrrCR#w0)v!79mHv7-@uU7hvOO8^;3^EeK=!K%5pal3;GIT{@VsVu{3H zJW<&oW3Y5wY8;X{(is3dL85wvq#C*R74UWMOwZxR0Goj*V?86&qHBQmNmXIdsr+_f OQPqUisc7r<=l=yD>bA82 literal 0 HcmV?d00001 diff --git a/app/assets/images/hogwarts_small.jpg b/app/assets/images/hogwarts_small.jpg new file mode 100644 index 0000000000000000000000000000000000000000..94a8abeff8c8b2c336d837008f00ad9e1c580f13 GIT binary patch literal 73659 zcmbT61ymft)}VVBU~qSLhu|={ySoP%2<{GnAOQjy+ycSfT>~UQaQ6@_xI@s8kc8~y zz1{cT?m26J&6%2SZr!TBx2n4PR(1bb`LhM!sVS){0U!_v$V7aAKRZ|^s`Bzrb@a5A zR5cV41pt7hqT%H3frJMDZtlL`ddhNiCZ=X|kZAx3KnG9(J^-+R`FLvTD;WTYq^c-S z=YvrC%l}T_mH|Xd0I-43Di*Je*UH@m+)h~QWLe)b3kYalqr z-^o4z!HWoHa`kg_LhyG46S>*j_y7Ph)?c}=JkfHqettumk|0VLAK<+x`dp z+6N-+1ORyt&meCn2S;BzHW)h{9~3G|r(z%AYVYgItz!dovGKN}llO4*v~dptfPeb@ zw-!L~w{PhXoh-};6&B{^=RtJ;ztaD)@LyX0XZSm||J1nA{l}PrNGAU+`*+=c%RGt! zK=cmLH_88&*=7SkM>GJCt^QlaR0sgLF9D!^=0E%)`8!`6eSJN}o;(Q%2;gzDhw=RF z(0`@>tHQrD|M&18$K&~Xynpo_or3){8$VZHy1$(Y^KkX>^QQChw1L^vasRKA_`h87 zKg{|MJGk`hpV@ocyCV)|gqUSc?hc6IcDHl#b@Fhhb8`RRjqrc5+JD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-Wv=ZO-pgnD595BSQXlupM23pQC&~}*-^jP2><{9 literal 0 HcmV?d00001 diff --git a/app/assets/images/icon_photo_small.png b/app/assets/images/icon_photo_small.png new file mode 100644 index 0000000000000000000000000000000000000000..0a900d16fb0ee5b0eeb92447a8b48871a29a5c08 GIT binary patch literal 7321 zcmai(WmFVE*T-QAk?s_vK`H52U=bD;SfqtTTv8NRQbJPc?o=eCON6CCme3`ndufpF zr9txHdB46No)35C%$f6_bI-kJ{&UW6B6YPPWW>zGI5;?D8tP#E`#J5uK}2{z%Hz5& z%Mn>Yv*8tgCj!~`f|~E){s^)(pkTN9>flVghzE&zBDjxVqvc6 zBGgDO+|#5l+?smIy(%XiS<3QYcB{Tj$2U-#@ETWX8jnIqJY=+~#0eX@(P8^8^-S+Ih+U0nv#%ZRk{A6Y}(smaCkDcLWg zMr+2Qc;n?;+Cqta1JuGDbmxORe_5l5`t}m{Z?(_3+I*ttMj|yV z^-$Wj2Uiz%4TN*Yj}FG9@B!t3bpK3huaRy(1#J${!?@w6J9HI9ErjwdQ*T8YEY0y4 zdy@aYbYf}de4AKPk!1OP=&wk;YlG+=h45F8lU;Z)>?*Uc$-0puazWtCur(5dsXKXe z0If2wY|^m&L~s#*IqC=SdaQR+n&j`kumLeQub^EZTp;iraVaKwab@oz>idWhIdaOg z^SOsh2IKLLx~7030BdwnJ7v9@Skhx)w`950q3K`t#XQ5+Xgy@UujbX4egIeeo3`SC z)qn>9pxTO-5`uwIIcf1c`Xi_@!s$op^O+wRCVC_{Vqbt}@jXu*f2RIQdE7_d?3v5d zN3Yp6vc>zU;;qj+s+lQ*pV7x z8=S^6Uk=3IhGkSi1x~nhhD9Yz_h{H3(AauNk17@;5TIRh`Ch`G7lV7P2!#8!>v8OS zv}3nal~Y&!uZyWlq|mjaJ^*Op6P1?Rd*J!&p%)jc!fV_y9*8&Xw%=}vfI4dQl}F05{B_bpnV7vu!!6LslUJtzdxV9$cLg~9|gCaK;%gB8EE(Vt}?8pT(?|T%d=F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E-1aeo`ux^V=^nLq~3?iE35SU2n4BlUl@x&O=U c?BIryDot+xwLW literal 0 HcmV?d00001 diff --git a/app/controllers/static_pages_controller.rb b/app/controllers/static_pages_controller.rb index cf48a8bb3..080a52729 100644 --- a/app/controllers/static_pages_controller.rb +++ b/app/controllers/static_pages_controller.rb @@ -1,4 +1,19 @@ class StaticPagesController < ApplicationController def home end + + def timeline + end + + def friends + end + + def about + end + + def photos + end + + def about_edit + end end diff --git a/app/views/static_pages/_homepage_navbar.html.erb b/app/views/static_pages/_homepage_navbar.html.erb new file mode 100644 index 000000000..c6cd4e369 --- /dev/null +++ b/app/views/static_pages/_homepage_navbar.html.erb @@ -0,0 +1,29 @@ + + \ No newline at end of file diff --git a/app/views/static_pages/_main_nav.html.erb b/app/views/static_pages/_main_nav.html.erb new file mode 100644 index 000000000..ad81e4558 --- /dev/null +++ b/app/views/static_pages/_main_nav.html.erb @@ -0,0 +1,29 @@ + \ No newline at end of file diff --git a/app/views/static_pages/_middle_nav.html.erb b/app/views/static_pages/_middle_nav.html.erb new file mode 100644 index 000000000..fa92a455a --- /dev/null +++ b/app/views/static_pages/_middle_nav.html.erb @@ -0,0 +1,18 @@ + + \ No newline at end of file diff --git a/app/views/static_pages/about.html.erb b/app/views/static_pages/about.html.erb new file mode 100644 index 000000000..2bef98cfb --- /dev/null +++ b/app/views/static_pages/about.html.erb @@ -0,0 +1,85 @@ +
+ <%= render :partial => "main_nav" %> + +
+
+ hogwarts +
profile picture + +
+

Harry Potter

+
+
+ +
+
+ + + <%= render :partial => "middle_nav", :locals => {:page=>"about"} %> + +
+
+
+
+ About + +
+ +
+ +
+ +
+
+

Basic Information

+ + + + + + + + + + + + + + + + + +
Birthday:July 31, 1980
College:Hogwarts College
Hometown:Godrick's Hollow, England
Currently Lives:Godrick's Hollow, England
+
+
+

Contact Information

+ + + + + + + + + +
Email:harry_potter@hogwarts.edu
Telephone:555-123-4567
+
+
+ +
+
+

Words to Live By

+

I'm Harry-Freaking Potter. I'm magical.

+
+
+

About Me

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum dui massa, dapibus in orci in, dictum venenatis nisl. Cras a finibus nunc. Duis et scelerisque odio, sed pharetra dui. Vivamus non nunc ante. Integer ut porta nisi, sed elementum diam. Suspendisse eget volutpat risus. Quisque egestas vulputate porttitor. Proin pellentesque enim eget viverra pharetra.

+

+
+
+
+
+ + + +
\ No newline at end of file diff --git a/app/views/static_pages/about_edit.html.erb b/app/views/static_pages/about_edit.html.erb new file mode 100644 index 000000000..c62a25c85 --- /dev/null +++ b/app/views/static_pages/about_edit.html.erb @@ -0,0 +1,86 @@ +
+ <%= render :partial => "main_nav" %> + +
+
+ hogwarts +
profile picture + +
+

Harry Potter

+
+
+ +
+
+ + + <%= render :partial => "middle_nav", :locals => {:page=>"about_edit"} %> + +
+
+
+

Edit Profile

+
+
+ +
+ +
+
+

Basic Information

+ + + + + + + + + + + + + + + + + +
Birthday:July 31, 1980
College:
Hometown:
Currently Lives:
+
+
+

Contact Information

+ + + + + + + + + +
Email:
Telephone:
+
+
+ +
+
+

Words to Live By

+

+
+
+

About Me

+

+

+
+ +
+
+ +
+
+
+
+
+ +
\ No newline at end of file diff --git a/app/views/static_pages/friends.html.erb b/app/views/static_pages/friends.html.erb new file mode 100644 index 000000000..cdc78da91 --- /dev/null +++ b/app/views/static_pages/friends.html.erb @@ -0,0 +1,100 @@ +
+ <%= render :partial => "main_nav" %> + +
+
+ hogwarts +
profile picture + +
+

Harry Potter

+
+
+ +
+
+ + + <%= render :partial => "middle_nav", :locals => {:page=>"friends"} %> + +
+
+
+
+ Friends +
+
+ + + + +
+
+
+ friends's picture +
+

Hermione Granger

+

432 Friends

+
+
+
+
+
+ friends's picture +
+

Hermione Granger

+

432 Friends

+
+
+
+
+ +
+
+
+ friends's picture +
+

Hermione Granger

+

432 Friends

+
+
+
+
+
+ friends's picture +
+

Hermione Granger

+

432 Friends

+
+
+
+
+ +
+
+
+ friends's picture +
+

Hermione Granger

+

432 Friends

+
+
+
+
+
+ friends's picture +
+

Hermione Granger

+

432 Friends

+
+
+
+
+
+
\ No newline at end of file diff --git a/app/views/static_pages/home.html.erb b/app/views/static_pages/home.html.erb index 8f846e513..fbc7c6f3c 100644 --- a/app/views/static_pages/home.html.erb +++ b/app/views/static_pages/home.html.erb @@ -1,32 +1,5 @@ - + <%= render :partial => "homepage_navbar" %>
diff --git a/app/views/static_pages/photos.html.erb b/app/views/static_pages/photos.html.erb new file mode 100644 index 000000000..b27a31f4b --- /dev/null +++ b/app/views/static_pages/photos.html.erb @@ -0,0 +1,93 @@ +
+ <%= render :partial => "main_nav" %> + +
+
+ hogwarts +
profile picture + +
+

Harry Potter

+
+
+ +
+
+ + + <%= render :partial => "middle_nav", :locals => {:page=>"photos"} %> + + \ No newline at end of file diff --git a/app/views/static_pages/timeline.html.erb b/app/views/static_pages/timeline.html.erb new file mode 100644 index 000000000..1031c82ba --- /dev/null +++ b/app/views/static_pages/timeline.html.erb @@ -0,0 +1,212 @@ +
+ <%= render :partial => "main_nav" %> + +
+
+ hogwarts +
profile picture + +
+

Harry Potter

+
+
+ +
+
+ + + <%= render :partial => "middle_nav", :locals => {:page=>"timeline"} %> +
+ +
+ +
+
+
+

About (Text Area)

+ + + + + + + + + + + + + + + + + +
Born on:July 31, 1980
Went to school at:Hogwarts College
Hometown:Godrick's Hollow, England
Currently Lives:Godrick's Hollow, England
+
+
+
+ +
+
+
+
+

Photos (123)

+
+
+ +
+
photo
+
photo
+
photo
+
+ +
+
photo
+
photo
+
photo
+
+ +
+
photo
+
photo
+
photo
+
+ + +
+
+ +
+
+
+
+

Friends (542)

+
+
+ + + + + + +
+
+
+ +
+ +
+

Post (copied)

+
+ +
+
+ +
+
+ +
+ harry picture +
+

Harry Potter

+ +
+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus nunc nunc, euismod in tristique a, viverra vitae sem. Donec ac condimentum mauris. Quisque molestie nisl urna, eu accumsan tortor lobortis id. Nullam vitae lacinia urna, at cursus metus. Phasellus non neque rhoncus, volutpat nibh sed, imperdiet magna.

+ +
+ +
+ harry picture +
+

Harry Potter

+ +
+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus nunc nunc, euismod in tristique a, viverra vitae sem. Donec ac condimentum mauris. Quisque molestie nisl urna, eu accumsan tortor lobortis id. Nullam vitae lacinia urna, at cursus metus. Phasellus non neque rhoncus, volutpat nibh sed, imperdiet magna.

+ +
+ +
+ friend's picture +
+

Harry Potter

+

+

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus nunc nunc, euismod in tristique a, viverra vitae sem. Donec ac condimentum mauris. Quisque molestie nisl urna, eu accumsan tortor lobortis id. Nullam vitae lacinia urna, at cursus metus. Phasellus non neque rhoncus, volutpat nibh sed, imperdiet magna.

+ + + + +
+
+
+
+
\ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 78a6b688f..5dadb6d70 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,4 +1,9 @@ Rails.application.routes.draw do root "static_pages#home" + get "timeline" => "static_pages#timeline" + get "friends" => "static_pages#friends" + get "about" => "static_pages#about" + get "photos" => "static_pages#photos" + get "about_edit" => "static_pages#about_edit" # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html end From 719a2cf3ce3aebedebc761ab329ed13b5b43189d Mon Sep 17 00:00:00 2001 From: David Jiang Date: Wed, 10 Aug 2016 16:48:30 -0700 Subject: [PATCH 04/39] added signup and signin --- Gemfile | 4 +- Gemfile.lock | 11 ++ app/assets/javascripts/sessions.coffee | 3 + app/assets/javascripts/users.coffee | 3 + app/assets/stylesheets/sessions.scss | 3 + app/assets/stylesheets/static_pages.scss | 2 +- app/assets/stylesheets/users.scss | 3 + app/controllers/application_controller.rb | 19 ++++ app/controllers/sessions_controller.rb | 21 ++++ app/controllers/static_pages_controller.rb | 1 + app/controllers/users_controller.rb | 25 +++++ app/helpers/sessions_helper.rb | 2 + app/helpers/users_helper.rb | 2 + app/models/user.rb | 21 ++++ app/views/layouts/application.html.erb | 7 ++ .../static_pages/_homepage_navbar.html.erb | 14 +-- app/views/static_pages/_main_nav.html.erb | 1 + app/views/static_pages/_sign_in_form.html.erb | 15 +++ app/views/static_pages/_sign_up_form.html.erb | 101 +++++++++++++++++ app/views/static_pages/home.html.erb | 103 +----------------- config/routes.rb | 4 + db/migrate/20160810213750_create_users.rb | 9 ++ .../20160810214323_add_token_to_users.rb | 6 + ...0810214744_add_password_digest_to_users.rb | 5 + db/schema.rb | 25 +++++ test/controllers/sessions_controller_test.rb | 7 ++ test/controllers/users_controller_test.rb | 7 ++ test/fixtures/users.yml | 11 ++ test/models/user_test.rb | 7 ++ 29 files changed, 326 insertions(+), 116 deletions(-) create mode 100644 app/assets/javascripts/sessions.coffee create mode 100644 app/assets/javascripts/users.coffee create mode 100644 app/assets/stylesheets/sessions.scss create mode 100644 app/assets/stylesheets/users.scss create mode 100644 app/controllers/sessions_controller.rb create mode 100644 app/controllers/users_controller.rb create mode 100644 app/helpers/sessions_helper.rb create mode 100644 app/helpers/users_helper.rb create mode 100644 app/models/user.rb create mode 100644 app/views/static_pages/_sign_in_form.html.erb create mode 100644 app/views/static_pages/_sign_up_form.html.erb create mode 100644 db/migrate/20160810213750_create_users.rb create mode 100644 db/migrate/20160810214323_add_token_to_users.rb create mode 100644 db/migrate/20160810214744_add_password_digest_to_users.rb create mode 100644 db/schema.rb create mode 100644 test/controllers/sessions_controller_test.rb create mode 100644 test/controllers/users_controller_test.rb create mode 100644 test/fixtures/users.yml create mode 100644 test/models/user_test.rb diff --git a/Gemfile b/Gemfile index 0447f7094..6ee78d4dc 100644 --- a/Gemfile +++ b/Gemfile @@ -25,7 +25,7 @@ gem 'jbuilder', '~> 2.5' # Use Redis adapter to run Action Cable in production # gem 'redis', '~> 3.0' # Use ActiveModel has_secure_password -# gem 'bcrypt', '~> 3.1.7' + gem 'bcrypt', '~> 3.1.7' # Use Capistrano for deployment # gem 'capistrano-rails', group: :development @@ -42,6 +42,8 @@ group :development do # 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' + gem 'better_errors' + gem 'binding_of_caller' end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem diff --git a/Gemfile.lock b/Gemfile.lock index 200d65bca..a8a650a30 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -39,8 +39,16 @@ GEM minitest (~> 5.1) tzinfo (~> 1.1) arel (7.1.1) + bcrypt (3.1.11) + better_errors (2.1.1) + coderay (>= 1.0.0) + erubis (>= 2.6.6) + rack (>= 0.9.0) + binding_of_caller (0.7.2) + debug_inspector (>= 0.0.1) builder (3.2.2) byebug (9.0.5) + coderay (1.1.1) coffee-rails (4.2.1) coffee-script (>= 2.2.0) railties (>= 4.0.0, < 5.2.x) @@ -155,6 +163,9 @@ PLATFORMS ruby DEPENDENCIES + bcrypt (~> 3.1.7) + better_errors + binding_of_caller byebug coffee-rails (~> 4.2) jbuilder (~> 2.5) diff --git a/app/assets/javascripts/sessions.coffee b/app/assets/javascripts/sessions.coffee new file mode 100644 index 000000000..24f83d18b --- /dev/null +++ b/app/assets/javascripts/sessions.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/users.coffee b/app/assets/javascripts/users.coffee new file mode 100644 index 000000000..24f83d18b --- /dev/null +++ b/app/assets/javascripts/users.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/sessions.scss b/app/assets/stylesheets/sessions.scss new file mode 100644 index 000000000..7bef9cf82 --- /dev/null +++ b/app/assets/stylesheets/sessions.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the sessions controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/static_pages.scss b/app/assets/stylesheets/static_pages.scss index 67bddc63e..466dadbe5 100644 --- a/app/assets/stylesheets/static_pages.scss +++ b/app/assets/stylesheets/static_pages.scss @@ -79,7 +79,7 @@ body { padding: 0; } -#user-name, #title-text { +#user-name, #title-text, #logout { color: white; } diff --git a/app/assets/stylesheets/users.scss b/app/assets/stylesheets/users.scss new file mode 100644 index 000000000..1efc835cc --- /dev/null +++ b/app/assets/stylesheets/users.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the users controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 1c07694e9..ebb63d0a6 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,3 +1,22 @@ class ApplicationController < ActionController::Base protect_from_forgery with: :exception + + private + + def sign_in(user) + user.regenerate_auth_token + cookies[:auth_token] = user.auth_token + @current_user = user + end + + def permanent_sign_in(user) + user.regenerate_auth_token + cookies.permanent[:auth_token] = user.auth_token + @current_user =user + end + + def sign_out + @current_user = nil + cookies.delete(:user_id) + end end diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb new file mode 100644 index 000000000..fbbf1c244 --- /dev/null +++ b/app/controllers/sessions_controller.rb @@ -0,0 +1,21 @@ +class SessionsController < ApplicationController + + def create + @user = User.find_by_email(params[:email]) + if @user && @user.authenticate(params[:password]) + sign_in(@user) + flash[:success] = "Welcome to Danebook!" + redirect_to timeline_path + else + flash[:error] = "We couldn't sign you in" + redirect_to root_path + end + end + + def destroy + sign_out + flash[:success] = "You've successfully signed out" + redirect_to root_url + end + +end diff --git a/app/controllers/static_pages_controller.rb b/app/controllers/static_pages_controller.rb index 080a52729..906389f67 100644 --- a/app/controllers/static_pages_controller.rb +++ b/app/controllers/static_pages_controller.rb @@ -1,5 +1,6 @@ class StaticPagesController < ApplicationController def home + @user = User.new end def timeline diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb new file mode 100644 index 000000000..a3646a546 --- /dev/null +++ b/app/controllers/users_controller.rb @@ -0,0 +1,25 @@ +class UsersController < ApplicationController + def new + @user = User.new + render "static_pages/home" + end + + def create + @user = User.new(user_params) + if @user.save + sign_in(@user) + flash[:success] = "Created new user!" + redirect_to timeline_path + else + flash[:error] = "Password #{@user.errors.messages[:password][0]}!" + redirect_to root_path + end + end + + private + + def user_params + params.require(:user).permit(:email,:password, :password_confirmation) + end + +end diff --git a/app/helpers/sessions_helper.rb b/app/helpers/sessions_helper.rb new file mode 100644 index 000000000..309f8b2eb --- /dev/null +++ b/app/helpers/sessions_helper.rb @@ -0,0 +1,2 @@ +module SessionsHelper +end diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb new file mode 100644 index 000000000..2310a240d --- /dev/null +++ b/app/helpers/users_helper.rb @@ -0,0 +1,2 @@ +module UsersHelper +end diff --git a/app/models/user.rb b/app/models/user.rb new file mode 100644 index 000000000..2fb486fad --- /dev/null +++ b/app/models/user.rb @@ -0,0 +1,21 @@ +class User < ApplicationRecord + has_secure_password + before_create :generate_token + + validates :password, + :length => {:in => 8..24}, + :allow_nil => true + + def generate_token + begin + self[:auth_token] = SecureRandom.urlsafe_base64 + end while User.exists?(:auth_token => self[:auth_token]) + end + + def regenerate_auth_token + self.auth_token = nil + generate_token + save! + end + +end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 993b35a2b..6c93e0c1f 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -16,6 +16,13 @@ + + <% flash.each do |key, value| %> +
+ <%= value %> +
+ <% end %> + <%= yield %> diff --git a/app/views/static_pages/_homepage_navbar.html.erb b/app/views/static_pages/_homepage_navbar.html.erb index c6cd4e369..be8a2e2a5 100644 --- a/app/views/static_pages/_homepage_navbar.html.erb +++ b/app/views/static_pages/_homepage_navbar.html.erb @@ -12,18 +12,6 @@
- + <%= render :partial => "static_pages/sign_in_form" %>
\ No newline at end of file diff --git a/app/views/static_pages/_main_nav.html.erb b/app/views/static_pages/_main_nav.html.erb index ad81e4558..e1c572aaa 100644 --- a/app/views/static_pages/_main_nav.html.erb +++ b/app/views/static_pages/_main_nav.html.erb @@ -24,6 +24,7 @@
+ <%= link_to "Logout", logout_path, :method => :delete, :class => "navbar-text", :id => "logout" %>
\ No newline at end of file diff --git a/app/views/static_pages/_sign_in_form.html.erb b/app/views/static_pages/_sign_in_form.html.erb new file mode 100644 index 000000000..609c3e659 --- /dev/null +++ b/app/views/static_pages/_sign_in_form.html.erb @@ -0,0 +1,15 @@ + <%= form_tag session_path, :class => "navbar-form navbar-right" do %> +
+ <%= label_tag :email, nil, :class => "control-label header-label" %> +
+ <%= text_field_tag :email, nil, :class => "form-control header-input" %> +
+
+ <%= label_tag :password, nil, :class =>"control-label header-label" %> +
+ <%= password_field_tag :password, nil, :class => "form-control header-input" %> +
+ <%= submit_tag "Log in", :class => "btn btn-default header-submit" %> + <% end %> + + \ No newline at end of file diff --git a/app/views/static_pages/_sign_up_form.html.erb b/app/views/static_pages/_sign_up_form.html.erb new file mode 100644 index 000000000..49cb5e2d2 --- /dev/null +++ b/app/views/static_pages/_sign_up_form.html.erb @@ -0,0 +1,101 @@ +
+

Sign Up

+ +
+
+ +
+
+ +
+
+ + <%= form_for user do |user_fields| %> +
+
+ <%= user_fields.text_field :email, placeholder: "Your Email", class: "sign-up-form" %> +
+
+ +
+
+ <%= user_fields.password_field :password, placeholder: "Your New Password", class: "sign-up-form" %> +
+
+ +
+
+ <%= user_fields.password_field :password_confirmation, placeholder: "Confirm Your Password", class: "sign-up-form" %> +
+
+

Birthday

+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ Female +
+
+ Male +
+
+ <%= user_fields.submit "Sign Up!", class: "btn btn-success sign-up-btn" %> + <% end %> + +
\ No newline at end of file diff --git a/app/views/static_pages/home.html.erb b/app/views/static_pages/home.html.erb index fbc7c6f3c..f6e42fa1f 100644 --- a/app/views/static_pages/home.html.erb +++ b/app/views/static_pages/home.html.erb @@ -1,5 +1,5 @@ - <%= render :partial => "homepage_navbar" %> + <%= render :partial => "static_pages/homepage_navbar" %>
@@ -14,106 +14,7 @@
-
-

Sign Up

-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-

Birthday

-
-
- -
-
- -
-
- -
-
- -
-
- Female -
-
- Male -
-
- -
-
+ <%= render :partial => "static_pages/sign_up_form", :locals=>{:user => @user} %>
diff --git a/config/routes.rb b/config/routes.rb index 5dadb6d70..1ee84d93c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -5,5 +5,9 @@ get "about" => "static_pages#about" get "photos" => "static_pages#photos" get "about_edit" => "static_pages#about_edit" + resources :users + resource :session, :only => [:new, :create, :destroy] + get "login" => "sessions#new" + delete "logout" => "sessions#destroy" # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html end diff --git a/db/migrate/20160810213750_create_users.rb b/db/migrate/20160810213750_create_users.rb new file mode 100644 index 000000000..f4ba137b5 --- /dev/null +++ b/db/migrate/20160810213750_create_users.rb @@ -0,0 +1,9 @@ +class CreateUsers < ActiveRecord::Migration[5.0] + def change + create_table :users do |t| + t.string :email + t.string :password + t.timestamps + end + end +end diff --git a/db/migrate/20160810214323_add_token_to_users.rb b/db/migrate/20160810214323_add_token_to_users.rb new file mode 100644 index 000000000..719c7ab9d --- /dev/null +++ b/db/migrate/20160810214323_add_token_to_users.rb @@ -0,0 +1,6 @@ +class AddTokenToUsers < ActiveRecord::Migration[5.0] + def change + add_column :users, :auth_token, :string + add_index :users, :auth_token, :unique => true + end +end diff --git a/db/migrate/20160810214744_add_password_digest_to_users.rb b/db/migrate/20160810214744_add_password_digest_to_users.rb new file mode 100644 index 000000000..30a8d13f3 --- /dev/null +++ b/db/migrate/20160810214744_add_password_digest_to_users.rb @@ -0,0 +1,5 @@ +class AddPasswordDigestToUsers < ActiveRecord::Migration[5.0] + def change + add_column :users, :password_digest, :string + end +end diff --git a/db/schema.rb b/db/schema.rb new file mode 100644 index 000000000..b1d18fc34 --- /dev/null +++ b/db/schema.rb @@ -0,0 +1,25 @@ +# 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: 20160810214744) do + + create_table "users", force: :cascade do |t| + t.string "email" + t.string "password" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "auth_token" + t.string "password_digest" + t.index ["auth_token"], name: "index_users_on_auth_token", unique: true + end + +end diff --git a/test/controllers/sessions_controller_test.rb b/test/controllers/sessions_controller_test.rb new file mode 100644 index 000000000..6135ce6af --- /dev/null +++ b/test/controllers/sessions_controller_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class SessionsControllerTest < ActionDispatch::IntegrationTest + # test "the truth" do + # assert true + # end +end diff --git a/test/controllers/users_controller_test.rb b/test/controllers/users_controller_test.rb new file mode 100644 index 000000000..6c3da770c --- /dev/null +++ b/test/controllers/users_controller_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class UsersControllerTest < ActionDispatch::IntegrationTest + # test "the truth" do + # assert true + # end +end diff --git a/test/fixtures/users.yml b/test/fixtures/users.yml new file mode 100644 index 000000000..80aed36e3 --- /dev/null +++ b/test/fixtures/users.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +# This model initially had no columns defined. If you add columns to the +# model remove the '{}' from the fixture names and add the columns immediately +# below each fixture, per the syntax in the comments below +# +one: {} +# column: value +# +two: {} +# column: value diff --git a/test/models/user_test.rb b/test/models/user_test.rb new file mode 100644 index 000000000..82f61e010 --- /dev/null +++ b/test/models/user_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class UserTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end From 49219a16166063540fbcf62363ec41c9622b1d0d Mon Sep 17 00:00:00 2001 From: David Jiang Date: Wed, 10 Aug 2016 16:54:49 -0700 Subject: [PATCH 05/39] preparing to deploy --- Gemfile | 6 +++++- Gemfile.lock | 11 +++++++++++ config/database.yml | 5 +++-- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 6ee78d4dc..88e90d5d3 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' - +ruby '2.2.4' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 5.0.0' # Use sqlite3 as the database for Active Record @@ -29,6 +29,10 @@ gem 'jbuilder', '~> 2.5' # Use Capistrano for deployment # gem 'capistrano-rails', group: :development +group :production do + gem 'rails_12factor' + gem 'pg' +end group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console diff --git a/Gemfile.lock b/Gemfile.lock index a8a650a30..08bc7eba6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -89,6 +89,7 @@ GEM nokogiri (1.6.8) mini_portile2 (~> 2.1.0) pkg-config (~> 1.1.7) + pg (0.18.4) pkg-config (1.1.7) puma (3.6.0) rack (2.0.1) @@ -111,6 +112,11 @@ GEM nokogiri (~> 1.6.0) rails-html-sanitizer (1.0.3) loofah (~> 2.0) + rails_12factor (0.0.3) + rails_serve_static_assets + rails_stdout_logging + rails_serve_static_assets (0.0.5) + rails_stdout_logging (0.0.5) railties (5.0.0) actionpack (= 5.0.0) activesupport (= 5.0.0) @@ -171,8 +177,10 @@ DEPENDENCIES jbuilder (~> 2.5) jquery-rails listen (~> 3.0.5) + pg puma (~> 3.0) rails (~> 5.0.0) + rails_12factor sass-rails (~> 5.0) spring spring-watcher-listen (~> 2.0.0) @@ -182,5 +190,8 @@ DEPENDENCIES uglifier (>= 1.3.0) web-console +RUBY VERSION + ruby 2.2.4p230 + BUNDLED WITH 1.12.5 diff --git a/config/database.yml b/config/database.yml index 1c1a37ca8..c2c37241e 100644 --- a/config/database.yml +++ b/config/database.yml @@ -21,5 +21,6 @@ test: database: db/test.sqlite3 production: - <<: *default - database: db/production.sqlite3 + adapter: postgresql + pool: 5 + timeout: 5000 From fd2c512101f5847c4f3c962eab590b175e6b3237 Mon Sep 17 00:00:00 2001 From: David Jiang Date: Wed, 10 Aug 2016 17:00:49 -0700 Subject: [PATCH 06/39] removing sql --- Gemfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 88e90d5d3..017e50612 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,6 @@ ruby '2.2.4' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 5.0.0' # Use sqlite3 as the database for Active Record -gem 'sqlite3' # Use Puma as the app server gem 'puma', '~> 3.0' # Use SCSS for stylesheets @@ -37,6 +36,8 @@ end group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem 'byebug', platform: :mri + # Use sqlite3 as the database for Active Record + gem 'sqlite3' end group :development do From 17ef89fe6243cf8ba34de83e822ed9a9612119fb Mon Sep 17 00:00:00 2001 From: David Jiang Date: Thu, 11 Aug 2016 17:28:50 -0700 Subject: [PATCH 07/39] about and edit about page --- app/controllers/application_controller.rb | 22 +++- app/controllers/sessions_controller.rb | 3 +- app/controllers/static_pages_controller.rb | 2 + app/controllers/users_controller.rb | 29 ++++- app/helpers/application_helper.rb | 13 ++ app/models/profile.rb | 8 ++ app/models/user.rb | 5 + app/views/static_pages/_main_nav.html.erb | 7 +- app/views/static_pages/_middle_nav.html.erb | 8 +- app/views/static_pages/_sign_up_form.html.erb | 86 ++++--------- app/views/users/edit.html.erb | 104 ++++++++++++++++ app/views/users/show.html.erb | 117 ++++++++++++++++++ db/migrate/20160811173909_create_profiles.rb | 20 +++ .../20160811183819_change_bday_for_profile.rb | 8 ++ db/schema.rb | 18 ++- test/fixtures/profiles.yml | 11 ++ test/models/profile_test.rb | 7 ++ 17 files changed, 393 insertions(+), 75 deletions(-) create mode 100644 app/models/profile.rb create mode 100644 app/views/users/edit.html.erb create mode 100644 app/views/users/show.html.erb create mode 100644 db/migrate/20160811173909_create_profiles.rb create mode 100644 db/migrate/20160811183819_change_bday_for_profile.rb create mode 100644 test/fixtures/profiles.yml create mode 100644 test/models/profile_test.rb diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index ebb63d0a6..fb59eb931 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -17,6 +17,26 @@ def permanent_sign_in(user) def sign_out @current_user = nil - cookies.delete(:user_id) + cookies.delete(:auth_token) end + + def current_user + @current_user ||= User.find_by_auth_token(cookies[:auth_token]) if cookies[:auth_token] + end + + def signed_in_user? + !!current_user + end + + def require_login + unless signed_in_user? + flash[:error] = "Not authorized, please sign in!" + redirect_to root_path + end + end + + def authorized_user? + params[:id]==current_user.id.to_s + end + helper_method :authorized_user? end diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index fbbf1c244..7c1e30a90 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -4,8 +4,7 @@ def create @user = User.find_by_email(params[:email]) if @user && @user.authenticate(params[:password]) sign_in(@user) - flash[:success] = "Welcome to Danebook!" - redirect_to timeline_path + redirect_to user_path(@user) else flash[:error] = "We couldn't sign you in" redirect_to root_path diff --git a/app/controllers/static_pages_controller.rb b/app/controllers/static_pages_controller.rb index 906389f67..0c76d4f68 100644 --- a/app/controllers/static_pages_controller.rb +++ b/app/controllers/static_pages_controller.rb @@ -1,6 +1,8 @@ class StaticPagesController < ApplicationController + before_action :require_login, :except => [:home] def home @user = User.new + redirect_to user_path(current_user.id) if signed_in_user? end def timeline diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index a3646a546..fdb58051e 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,25 +1,46 @@ class UsersController < ApplicationController def new @user = User.new + #@user.build_profile render "static_pages/home" end def create @user = User.new(user_params) + if @user.save sign_in(@user) flash[:success] = "Created new user!" - redirect_to timeline_path + redirect_to user_path(@user) else - flash[:error] = "Password #{@user.errors.messages[:password][0]}!" - redirect_to root_path + render "static_pages/home" + end + end + + #about page + def show + @user = User.find(params[:id]) + @profile = @user.profile + end + + def edit + @user = User.find(params[:id]) + @profile = @user.profile + end + + def update + @user = User.find(params[:id]) + if @user.update(user_params) + redirect_to user_path(@user) + else + render :edit end end private def user_params - params.require(:user).permit(:email,:password, :password_confirmation) + params.require(:user).permit(:email,:password, :password_confirmation, :profile_attributes=>[:first_name, :last_name, :birthday, :gender, :college, :hometown, :currently_lives, :telephone, :words_to_live_by, :about_me]) end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index de6be7945..6e09483c7 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,2 +1,15 @@ module ApplicationHelper + + def date_wrap_open + '
'.html_safe + end + + def date_wrap_close + '
'.html_safe + end + + def date_separator + "#{date_wrap_close}#{date_wrap_open}" + end + end diff --git a/app/models/profile.rb b/app/models/profile.rb new file mode 100644 index 000000000..a67bdae00 --- /dev/null +++ b/app/models/profile.rb @@ -0,0 +1,8 @@ +class Profile < ApplicationRecord + belongs_to :user, inverse_of: :profile + validates :first_name, :last_name, :gender, :birthday, presence: true + + def full_name + "#{first_name} #{last_name}" + end +end diff --git a/app/models/user.rb b/app/models/user.rb index 2fb486fad..2950ecb74 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -6,6 +6,11 @@ class User < ApplicationRecord :length => {:in => 8..24}, :allow_nil => true + validates_format_of :email, :with => /@/ + + has_one :profile, inverse_of: :user + accepts_nested_attributes_for :profile + def generate_token begin self[:auth_token] = SecureRandom.urlsafe_base64 diff --git a/app/views/static_pages/_main_nav.html.erb b/app/views/static_pages/_main_nav.html.erb index e1c572aaa..0f16cea0c 100644 --- a/app/views/static_pages/_main_nav.html.erb +++ b/app/views/static_pages/_main_nav.html.erb @@ -8,7 +8,8 @@ @@ -23,7 +24,9 @@
- + <%= link_to "Logout", logout_path, :method => :delete, :class => "navbar-text", :id => "logout" %>
diff --git a/app/views/static_pages/_middle_nav.html.erb b/app/views/static_pages/_middle_nav.html.erb index fa92a455a..10dcd0338 100644 --- a/app/views/static_pages/_middle_nav.html.erb +++ b/app/views/static_pages/_middle_nav.html.erb @@ -10,9 +10,11 @@
<% unless page == 'about_edit' %>
- - - + <% if authorized_user? %> + + <% end %>
<% end %>
\ No newline at end of file diff --git a/app/views/static_pages/_sign_up_form.html.erb b/app/views/static_pages/_sign_up_form.html.erb index 49cb5e2d2..4332c8aba 100644 --- a/app/views/static_pages/_sign_up_form.html.erb +++ b/app/views/static_pages/_sign_up_form.html.erb @@ -1,25 +1,33 @@
-

Sign Up

+

Sign Up

+ <%= form_for user do |user_fields| %> + <%= user_fields.fields_for :profile_attributes do |profile_fields| %>
- + + <%= profile_fields.text_field :first_name, placeholder: "First Name", class: "sign-up-form" %> + <%= user.errors["profile.first_name"] if user.errors["profile.first_name"].any? %>
- + <%= profile_fields.text_field :last_name, placeholder: "Last Name", class: "sign-up-form" %> + <%= user.errors["profile.last_name"] if user.errors["profile.first_name"].any? %>
+ <%# end %> - <%= form_for user do |user_fields| %> +
<%= user_fields.text_field :email, placeholder: "Your Email", class: "sign-up-form" %> + <%= user.errors["email"] if user.errors["email"].any? %>
<%= user_fields.password_field :password, placeholder: "Your New Password", class: "sign-up-form" %> + <%= user.errors["password"] if user.errors["password"].any? %>
@@ -29,73 +37,27 @@

Birthday

+ <%# fields_for :profile do |profile_fields| %>
-
- -
-
- -
-
- -
+ <%= date_wrap_open %> + <%= profile_fields.date_select(:birthday, {:start_year => 1916, :end_year => 2000, :order => [:month, :day, :year], :default =>{year: 2000}, :date_separator => date_separator }, {:class => 'form-control'}) %> + <%= date_wrap_close %>
+ <%# end %> + <%# fields_for :profile do |profile_fields| %>
- Female + <%= profile_fields.label :gender, "Female"%> + <%= profile_fields.radio_button :gender, "female" %>
- Male + <%= profile_fields.label :gender, "Male" %> + <%= profile_fields.radio_button :gender, "male" %> + <%= user.errors["profile.gender"] if user.errors["profile.gender"].any? %>
+ <% end %> <%= user_fields.submit "Sign Up!", class: "btn btn-success sign-up-btn" %> <% end %> - \ No newline at end of file diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb new file mode 100644 index 000000000..847c4bbc7 --- /dev/null +++ b/app/views/users/edit.html.erb @@ -0,0 +1,104 @@ +
+ <%= render :partial => "static_pages/main_nav", :locals=>{:profile => @profile} %> + +
+
+ <%= image_tag "hogwarts_small.jpg", alt:"hogwarts" %> +
+ <%= image_tag "harry_potter_small.jpg", alt: "profile picture", class: "img-responsive img-thumbnail" %> +
+
+

<%= @profile.full_name %>

+
+
+
+ +
+
+ + + <%= render :partial => "static_pages/middle_nav", :locals => {:page=>"about_edit", :user => @user} %> + +
+
+
+

Edit Profile

+
+
+ + + + <%= form_for @user do |user_fields| %> + <%= user_fields.fields_for :profile_attributes, @profile do |profile_fields| %> +
+ +
+
+

Basic Information

+ + + + + + + + + + + + + + + + + +
Birthday: + <%= @profile.birthday.strftime("%B %-d %Y") %> +
College:<%= profile_fields.text_field :college %>
Hometown:<%= profile_fields.text_field :hometown %>
Currently Lives:<%= profile_fields.text_field :currently_lives %>
+
+
+

Contact Information

+ + + + + + + + + +
Email:<%= user_fields.text_field :email %>
Telephone:<%= profile_fields.text_field :telephone %>
+
+
+ +
+
+

Words to Live By

+

<%= profile_fields.text_area :words_to_live_by, {rows: 2, cols: 50} %>

+
+
+

About Me

+

<%= profile_fields.text_area :about_me, {rows: 5, cols: 50} %>

+
+
+ <%= profile_fields.hidden_field :first_name, :value => @profile.first_name %> + <%= profile_fields.hidden_field :last_name, :value => @profile.last_name %> + <%= profile_fields.hidden_field :gender, :value => @profile.gender %> + <%= profile_fields.hidden_field :birthday, :value => @profile.birthday %> + <% end %> + + +
+
+ <%= user_fields.submit "Save Changes", {class: "btn btn-primary btn-lg", id: "save_changes"} %> +
+
+ <% end %> + +
+
+
+ + + +
\ No newline at end of file diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb new file mode 100644 index 000000000..1200c4ea1 --- /dev/null +++ b/app/views/users/show.html.erb @@ -0,0 +1,117 @@ +
+ <%= render :partial => "static_pages/main_nav", :locals=>{:profile => @profile} %> + +
+
+ <%= image_tag "hogwarts_small.jpg", alt:"hogwarts" %> +
+ <%= image_tag "harry_potter_small.jpg", alt: "profile picture", class: "img-responsive img-thumbnail" %> +
+
+

<%= @profile.full_name %>

+
+
+
+ +
+
+ + + <%= render :partial => "static_pages/middle_nav", :locals => {:page=>"about", :user => @user} %> + +
+
+
+
+ About + <% if authorized_user? %> + + <% end %> +
+ +
+ +
+ +
+
+

Basic Information

+ + + + + + + + <% if @profile.college %> + + <% else %> + + <% end %> + + + + <% if @profile.hometown %> + + <% else %> + + <% end %> + + + + <% if @profile.currently_lives %> + + <% else %> + + <% end %> + +
Birthday: + <%= @profile.birthday.strftime("%B %-d %Y") %> +
College:<%= @profile.college %>Nothing here yet!
Hometown:<%= @profile.hometown %>Nothing here yet!
Currently Lives:<%= @profile.currently_lives %>Nothing here yet!
+
+
+

Contact Information

+ + + + + + + + <% if @profile.telephone %> + + <% else %> + + <% end %> + +
Email:<%= @user.email %>
Telephone:<%= @profile.telephone %>Call me maybe?
+
+
+ +
+
+

Words to Live By

+ <% if @profile.words_to_live_by %> +

<%= @profile.words_to_live_by %>

+ <% else %> +

Fill me out!

+ <% end %> +
+
+

About Me

+ <% if @profile.about_me %> +

<%= @profile.about_me %>

+ <% else %> +

Tell us about yourself!

+ <% end %> +
+
+
+
+
+ + + +
\ No newline at end of file diff --git a/db/migrate/20160811173909_create_profiles.rb b/db/migrate/20160811173909_create_profiles.rb new file mode 100644 index 000000000..af5552af6 --- /dev/null +++ b/db/migrate/20160811173909_create_profiles.rb @@ -0,0 +1,20 @@ +class CreateProfiles < ActiveRecord::Migration[5.0] + def change + create_table :profiles do |t| + t.string :first_name + t.string :last_name + t.integer :bday_month + t.integer :bday_day + t.integer :bday_year + t.string :gender + t.string :college + t.string :hometown + t.string :currently_lives + t.string :telephone + t.text :words_to_live_by + t.text :about_me + t.integer :user_id + t.timestamps + end + end +end diff --git a/db/migrate/20160811183819_change_bday_for_profile.rb b/db/migrate/20160811183819_change_bday_for_profile.rb new file mode 100644 index 000000000..8c92b7dda --- /dev/null +++ b/db/migrate/20160811183819_change_bday_for_profile.rb @@ -0,0 +1,8 @@ +class ChangeBdayForProfile < ActiveRecord::Migration[5.0] + def change + remove_column :profiles, :bday_month + remove_column :profiles, :bday_day + remove_column :profiles, :bday_year + add_column :profiles, :birthday, :date + end +end diff --git a/db/schema.rb b/db/schema.rb index b1d18fc34..72b099584 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,23 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20160810214744) do +ActiveRecord::Schema.define(version: 20160811183819) do + + create_table "profiles", force: :cascade do |t| + t.string "first_name" + t.string "last_name" + t.string "gender" + t.string "college" + t.string "hometown" + t.string "currently_lives" + t.string "telephone" + t.text "words_to_live_by" + t.text "about_me" + t.integer "user_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.date "birthday" + end create_table "users", force: :cascade do |t| t.string "email" diff --git a/test/fixtures/profiles.yml b/test/fixtures/profiles.yml new file mode 100644 index 000000000..80aed36e3 --- /dev/null +++ b/test/fixtures/profiles.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +# This model initially had no columns defined. If you add columns to the +# model remove the '{}' from the fixture names and add the columns immediately +# below each fixture, per the syntax in the comments below +# +one: {} +# column: value +# +two: {} +# column: value diff --git a/test/models/profile_test.rb b/test/models/profile_test.rb new file mode 100644 index 000000000..3dfa94302 --- /dev/null +++ b/test/models/profile_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class ProfileTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end From c548ade16056e54fd5dfe52748fefac966a36070 Mon Sep 17 00:00:00 2001 From: David Jiang Date: Fri, 12 Aug 2016 09:26:17 -0700 Subject: [PATCH 08/39] added login requirements --- app/assets/javascripts/posts.coffee | 3 +++ app/assets/stylesheets/posts.scss | 3 +++ app/controllers/application_controller.rb | 9 +++++++++ app/controllers/posts_controller.rb | 2 ++ app/controllers/sessions_controller.rb | 1 + app/controllers/static_pages_controller.rb | 7 ++++++- app/controllers/users_controller.rb | 3 +++ app/helpers/posts_helper.rb | 2 ++ app/models/post.rb | 4 ++++ app/models/user.rb | 2 ++ app/views/layouts/application.html.erb | 8 +++----- app/views/static_pages/about.html.erb | 2 +- app/views/static_pages/about_edit.html.erb | 2 +- app/views/static_pages/friends.html.erb | 2 +- app/views/static_pages/photos.html.erb | 2 +- app/views/static_pages/timeline.html.erb | 2 +- config/routes.rb | 4 +++- db/migrate/20160812160131_create_posts.rb | 9 +++++++++ db/schema.rb | 9 ++++++++- test/controllers/posts_controller_test.rb | 7 +++++++ test/fixtures/posts.yml | 11 +++++++++++ test/models/post_test.rb | 7 +++++++ 22 files changed, 88 insertions(+), 13 deletions(-) create mode 100644 app/assets/javascripts/posts.coffee create mode 100644 app/assets/stylesheets/posts.scss create mode 100644 app/controllers/posts_controller.rb create mode 100644 app/helpers/posts_helper.rb create mode 100644 app/models/post.rb create mode 100644 db/migrate/20160812160131_create_posts.rb create mode 100644 test/controllers/posts_controller_test.rb create mode 100644 test/fixtures/posts.yml create mode 100644 test/models/post_test.rb diff --git a/app/assets/javascripts/posts.coffee b/app/assets/javascripts/posts.coffee new file mode 100644 index 000000000..24f83d18b --- /dev/null +++ b/app/assets/javascripts/posts.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/posts.scss b/app/assets/stylesheets/posts.scss new file mode 100644 index 000000000..1a7e15390 --- /dev/null +++ b/app/assets/stylesheets/posts.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the posts controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index fb59eb931..b9a62db89 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,5 +1,6 @@ class ApplicationController < ActionController::Base protect_from_forgery with: :exception + before_action :require_login private @@ -39,4 +40,12 @@ def authorized_user? params[:id]==current_user.id.to_s end helper_method :authorized_user? + + def require_authorized_user + unless authorized_user? + flash[:error] = "You're not allowed to view that page" + redirect_to root_path + end + end + end diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb new file mode 100644 index 000000000..a66e6b8f8 --- /dev/null +++ b/app/controllers/posts_controller.rb @@ -0,0 +1,2 @@ +class PostsController < ApplicationController +end diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 7c1e30a90..cf5f27591 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -1,4 +1,5 @@ class SessionsController < ApplicationController +skip_before_action :require_login, :only => [:create] def create @user = User.find_by_email(params[:email]) diff --git a/app/controllers/static_pages_controller.rb b/app/controllers/static_pages_controller.rb index 0c76d4f68..ed9b4b0df 100644 --- a/app/controllers/static_pages_controller.rb +++ b/app/controllers/static_pages_controller.rb @@ -1,22 +1,27 @@ class StaticPagesController < ApplicationController - before_action :require_login, :except => [:home] + skip_before_action :require_login, :only => [:home] def home @user = User.new redirect_to user_path(current_user.id) if signed_in_user? end def timeline + @profile = false end def friends + @profile = false end def about + @profile = false end def photos + @profile= false end def about_edit + @profile = false end end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index fdb58051e..905523875 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,4 +1,7 @@ class UsersController < ApplicationController + skip_before_action :require_login, :only => [:new, :create] + before_action :require_authorized_user, :only => [:edit, :update, :destroy] + def new @user = User.new #@user.build_profile diff --git a/app/helpers/posts_helper.rb b/app/helpers/posts_helper.rb new file mode 100644 index 000000000..a7b8cec89 --- /dev/null +++ b/app/helpers/posts_helper.rb @@ -0,0 +1,2 @@ +module PostsHelper +end diff --git a/app/models/post.rb b/app/models/post.rb new file mode 100644 index 000000000..6ffea8ea1 --- /dev/null +++ b/app/models/post.rb @@ -0,0 +1,4 @@ +class Post < ApplicationRecord + belongs_to :user + validates :body, presence: true +end diff --git a/app/models/user.rb b/app/models/user.rb index 2950ecb74..3c2ed555d 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -11,6 +11,8 @@ class User < ApplicationRecord has_one :profile, inverse_of: :user accepts_nested_attributes_for :profile + has_many :posts + def generate_token begin self[:auth_token] = SecureRandom.urlsafe_base64 diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 6c93e0c1f..b8ae86a9d 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -15,14 +15,12 @@ <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %> - - - <% flash.each do |key, value| %> + + <% flash.each do |key, value| %>
<%= value %>
- <% end %> - + <% end %> <%= yield %> diff --git a/app/views/static_pages/about.html.erb b/app/views/static_pages/about.html.erb index 2bef98cfb..03fcdb805 100644 --- a/app/views/static_pages/about.html.erb +++ b/app/views/static_pages/about.html.erb @@ -1,5 +1,5 @@
- <%= render :partial => "main_nav" %> + <%= render :partial => "main_nav", :locals => {profile: @profile} %>
diff --git a/app/views/static_pages/about_edit.html.erb b/app/views/static_pages/about_edit.html.erb index c62a25c85..2a65e396f 100644 --- a/app/views/static_pages/about_edit.html.erb +++ b/app/views/static_pages/about_edit.html.erb @@ -1,5 +1,5 @@
- <%= render :partial => "main_nav" %> + <%= render :partial => "main_nav", :locals => {profile: @profile} %>
diff --git a/app/views/static_pages/friends.html.erb b/app/views/static_pages/friends.html.erb index cdc78da91..f9e2e7f2e 100644 --- a/app/views/static_pages/friends.html.erb +++ b/app/views/static_pages/friends.html.erb @@ -1,5 +1,5 @@
- <%= render :partial => "main_nav" %> + <%= render :partial => "main_nav", :locals => {profile: @profile} %>
diff --git a/app/views/static_pages/photos.html.erb b/app/views/static_pages/photos.html.erb index b27a31f4b..f7f35e53f 100644 --- a/app/views/static_pages/photos.html.erb +++ b/app/views/static_pages/photos.html.erb @@ -1,5 +1,5 @@
- <%= render :partial => "main_nav" %> + <%= render :partial => "main_nav", :locals => {profile: @profile} %>
diff --git a/app/views/static_pages/timeline.html.erb b/app/views/static_pages/timeline.html.erb index 1031c82ba..ea3756cbb 100644 --- a/app/views/static_pages/timeline.html.erb +++ b/app/views/static_pages/timeline.html.erb @@ -1,5 +1,5 @@
- <%= render :partial => "main_nav" %> + <%= render :partial => "main_nav", :locals => {profile: @profile} %>
diff --git a/config/routes.rb b/config/routes.rb index 1ee84d93c..931d3c709 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -5,7 +5,9 @@ get "about" => "static_pages#about" get "photos" => "static_pages#photos" get "about_edit" => "static_pages#about_edit" - resources :users + resources :users do + resource :posts + end resource :session, :only => [:new, :create, :destroy] get "login" => "sessions#new" delete "logout" => "sessions#destroy" diff --git a/db/migrate/20160812160131_create_posts.rb b/db/migrate/20160812160131_create_posts.rb new file mode 100644 index 000000000..10785689c --- /dev/null +++ b/db/migrate/20160812160131_create_posts.rb @@ -0,0 +1,9 @@ +class CreatePosts < ActiveRecord::Migration[5.0] + def change + create_table :posts do |t| + t.string :body + t.integer :user_id + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 72b099584..d766bd034 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,14 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20160811183819) do +ActiveRecord::Schema.define(version: 20160812160131) do + + create_table "posts", force: :cascade do |t| + t.string "body" + t.integer "user_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end create_table "profiles", force: :cascade do |t| t.string "first_name" diff --git a/test/controllers/posts_controller_test.rb b/test/controllers/posts_controller_test.rb new file mode 100644 index 000000000..12c4a7fd0 --- /dev/null +++ b/test/controllers/posts_controller_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class PostsControllerTest < ActionDispatch::IntegrationTest + # test "the truth" do + # assert true + # end +end diff --git a/test/fixtures/posts.yml b/test/fixtures/posts.yml new file mode 100644 index 000000000..80aed36e3 --- /dev/null +++ b/test/fixtures/posts.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +# This model initially had no columns defined. If you add columns to the +# model remove the '{}' from the fixture names and add the columns immediately +# below each fixture, per the syntax in the comments below +# +one: {} +# column: value +# +two: {} +# column: value diff --git a/test/models/post_test.rb b/test/models/post_test.rb new file mode 100644 index 000000000..6d9d463a7 --- /dev/null +++ b/test/models/post_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class PostTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end From e860664fa7ec6e9cd019ea0b6a1beee09d949af2 Mon Sep 17 00:00:00 2001 From: David Jiang Date: Fri, 12 Aug 2016 11:43:32 -0700 Subject: [PATCH 09/39] can add and delete posts --- app/assets/stylesheets/static_pages.scss | 4 +- app/controllers/application_controller.rb | 7 +- app/controllers/posts_controller.rb | 46 ++++++ app/models/post.rb | 4 + app/views/posts/_timeline_bottom.html.erb | 38 +++++ app/views/posts/_timeline_top.html.erb | 150 ++++++++++++++++++++ app/views/posts/index.html.erb | 2 + app/views/posts/new.html.erb | 11 ++ app/views/static_pages/_main_nav.html.erb | 4 +- app/views/static_pages/_main_photo.html.erb | 11 ++ app/views/static_pages/_middle_nav.html.erb | 8 +- app/views/users/show.html.erb | 12 +- config/routes.rb | 2 +- 13 files changed, 281 insertions(+), 18 deletions(-) create mode 100644 app/views/posts/_timeline_bottom.html.erb create mode 100644 app/views/posts/_timeline_top.html.erb create mode 100644 app/views/posts/index.html.erb create mode 100644 app/views/posts/new.html.erb create mode 100644 app/views/static_pages/_main_photo.html.erb diff --git a/app/assets/stylesheets/static_pages.scss b/app/assets/stylesheets/static_pages.scss index 466dadbe5..f20b68639 100644 --- a/app/assets/stylesheets/static_pages.scss +++ b/app/assets/stylesheets/static_pages.scss @@ -79,7 +79,7 @@ body { padding: 0; } -#user-name, #title-text, #logout { +#user-name, #title-text, #logout, #profile-name{ color: white; } @@ -99,7 +99,7 @@ body { left: 12%; } -#profile-name { +#big-profile-name { position: absolute; bottom: 0; left: 33%; diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index b9a62db89..a7528b440 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -24,6 +24,7 @@ def sign_out def current_user @current_user ||= User.find_by_auth_token(cookies[:auth_token]) if cookies[:auth_token] end + helper_method :current_user def signed_in_user? !!current_user @@ -37,7 +38,11 @@ def require_login end def authorized_user? - params[:id]==current_user.id.to_s + if params[:user_id] + params[:user_id]==current_user.id.to_s + else + params[:id]==current_user.id.to_s + end end helper_method :authorized_user? diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index a66e6b8f8..8549fff4a 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -1,2 +1,48 @@ class PostsController < ApplicationController +before_action :require_authorized_user, :except => [:index] + def index + #show all the user's posts + #redirect to new if authorized_user + @user = User.find(params[:user_id]) + @posts = @user.posts.order(updated_at: :desc) + @profile = @user.profile + if params[:user_id] == current_user.id.to_s + redirect_to new_user_post_path(current_user) + end + end + + def new + #everything in index, plus a form to make a new post + @user = current_user + @profile = @user.profile + @posts = @user.posts.order(updated_at: :desc) + @post = @user.posts.build + end + + def create + @post = current_user.posts.build(post_params) + if @post.save + redirect_to new_user_post_path(current_user) + else + render :new + end + end + + def edit + end + + def update + end + + def destroy + @post = Post.find(params[:id]) + @post.destroy + redirect_to new_user_post_path(current_user) + end + + private + + def post_params + params.require(:post).permit(:body) + end end diff --git a/app/models/post.rb b/app/models/post.rb index 6ffea8ea1..4477f846c 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -1,4 +1,8 @@ class Post < ApplicationRecord belongs_to :user validates :body, presence: true + + def posted_date + updated_at.strftime("%A %m/%d/%Y") + end end diff --git a/app/views/posts/_timeline_bottom.html.erb b/app/views/posts/_timeline_bottom.html.erb new file mode 100644 index 000000000..3086006a4 --- /dev/null +++ b/app/views/posts/_timeline_bottom.html.erb @@ -0,0 +1,38 @@ + + <% if user.posts.empty? %> +

+ <%= user.profile.first_name %> has no posts yet! +

+ <% end %> + <% posts.each do |post| %> + <% if post.id %> +
+ + <%= image_tag "harry_potter_small.jpg", alt: "harry picture", class: "side-image, small-image" %> + +
+

+ <%= link_to post.user.profile.full_name, user_path(post.user) %> +

+ +
+

+ <%= post.body %> +

+ +
+ <% end %> + <% end %> + +
+
+
+
\ No newline at end of file diff --git a/app/views/posts/_timeline_top.html.erb b/app/views/posts/_timeline_top.html.erb new file mode 100644 index 000000000..db92f5a09 --- /dev/null +++ b/app/views/posts/_timeline_top.html.erb @@ -0,0 +1,150 @@ +
+ <%= render :partial => "static_pages/main_nav", :locals => {profile: profile} %> + + <%= render :partial => "static_pages/main_photo", :locals=>{:profile=> profile} %> + +
+
+ + + <%= render :partial => "static_pages/middle_nav", :locals => {:page=>"timeline", :user => user} %> +
+ +
+ +
+
+
+

About

+ + + + + + + + <% if profile.college %> + + <% else %> + + <% end %> + + + + <% if profile.hometown %> + + <% else %> + + <% end %> + + + + <% if profile.currently_lives %> + + <% else %> + + <% end %> + +
Born on: + <%= profile.birthday.strftime("%B %-d %Y") %> +
Went to school at:<%= profile.college %>Nothing here yet!
Hometown:<%= profile.hometown %>Nothing here yet!
Currently Lives:<%= profile.currently_lives %>Nothing here yet!
+
+
+
+ +
+ +
+ +
+ +
+
+ +
\ No newline at end of file diff --git a/app/views/posts/index.html.erb b/app/views/posts/index.html.erb new file mode 100644 index 000000000..34b931416 --- /dev/null +++ b/app/views/posts/index.html.erb @@ -0,0 +1,2 @@ +<%= render :partial => "timeline_top", :locals => {:profile => @profile, :user => @user} %> +<%= render :partial => "timeline_bottom", :locals => {:user => @user, :posts => @posts} %> \ No newline at end of file diff --git a/app/views/posts/new.html.erb b/app/views/posts/new.html.erb new file mode 100644 index 000000000..0cbf84f81 --- /dev/null +++ b/app/views/posts/new.html.erb @@ -0,0 +1,11 @@ +<%= render :partial => "timeline_top", :locals => {:profile => @profile, :user => @user} %> +
+

Post

+ <%= form_for [@user, @post] do |post_fields| %> + <%= post_fields.text_area :body, cols: 60, rows: 5, placeholder: "Tell the world something...", class: "post-textarea" %> +
+ <%= post_fields.submit "Post", class: "btn btn-primary" %> +
+ <% end %> +
+<%= render :partial => "timeline_bottom", :locals => {:user => @user, :posts => @posts} %> \ No newline at end of file diff --git a/app/views/static_pages/_main_nav.html.erb b/app/views/static_pages/_main_nav.html.erb index 0f16cea0c..7366b7dad 100644 --- a/app/views/static_pages/_main_nav.html.erb +++ b/app/views/static_pages/_main_nav.html.erb @@ -25,7 +25,9 @@
<%= link_to "Logout", logout_path, :method => :delete, :class => "navbar-text", :id => "logout" %>
diff --git a/app/views/static_pages/_main_photo.html.erb b/app/views/static_pages/_main_photo.html.erb new file mode 100644 index 000000000..e0d3b1921 --- /dev/null +++ b/app/views/static_pages/_main_photo.html.erb @@ -0,0 +1,11 @@ +
+
+ <%= image_tag "hogwarts_small.jpg", alt:"hogwarts" %> +
+ <%= image_tag "harry_potter_small.jpg", alt: "profile picture", class: "img-responsive img-thumbnail" %> +
+
+

<%= @profile.full_name %>

+
+
+
\ No newline at end of file diff --git a/app/views/static_pages/_middle_nav.html.erb b/app/views/static_pages/_middle_nav.html.erb index 10dcd0338..a5b0f8972 100644 --- a/app/views/static_pages/_middle_nav.html.erb +++ b/app/views/static_pages/_middle_nav.html.erb @@ -2,8 +2,12 @@
diff --git a/app/views/static_pages/timeline.html.erb b/app/views/static_pages/timeline.html.erb index ea3756cbb..40d133624 100644 --- a/app/views/static_pages/timeline.html.erb +++ b/app/views/static_pages/timeline.html.erb @@ -175,7 +175,7 @@ friend's picture

Ron Weasley

-

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus nunc nunc, euismod in tristique a, viverra vitae sem. Donec ac condimentum mauris. Quisque molestie nisl urna, eu accumsan tortor lobortis id. Nullam vitae lacinia urna, at cursus metus. Phasellus non neque rhoncus, volutpat nibh sed, imperdiet magna.

+
<% end %> <% end %> diff --git a/config/routes.rb b/config/routes.rb index 0632604e5..d046efeab 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -12,6 +12,9 @@ resources :likes, :only=>[:create,:destroy] resources :comments, :only=>[:create, :destroy] end + resources :comments, :only=>[] do + resources :likes, :only=>[:create,:destroy] + end resource :session, :only => [:new, :create, :destroy] get "login" => "sessions#new" delete "logout" => "sessions#destroy" diff --git a/db/migrate/20160813220529_make_comments_polymorphic.rb b/db/migrate/20160813220529_make_comments_polymorphic.rb new file mode 100644 index 000000000..3be094c48 --- /dev/null +++ b/db/migrate/20160813220529_make_comments_polymorphic.rb @@ -0,0 +1,8 @@ +class MakeCommentsPolymorphic < ActiveRecord::Migration[5.0] + def change + remove_column :likes, :post_id + add_column :likes, :likeable_id, :integer + add_column :likes, :likeable_type, :string + add_index :likes, [:likeable_type, :likeable_id] + end +end diff --git a/db/schema.rb b/db/schema.rb index f08b7f049..c426ce1ae 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: 20160812221810) do +ActiveRecord::Schema.define(version: 20160813220529) do create_table "comments", force: :cascade do |t| t.integer "user_id" @@ -21,10 +21,12 @@ end create_table "likes", force: :cascade do |t| - t.integer "post_id" t.integer "user_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "likeable_id" + t.string "likeable_type" + t.index ["likeable_type", "likeable_id"], name: "index_likes_on_likeable_type_and_likeable_id" end create_table "posts", force: :cascade do |t| From 4114c101d9ba131a000969da100f4e7124f8e6b1 Mon Sep 17 00:00:00 2001 From: David Jiang Date: Sat, 13 Aug 2016 16:48:11 -0700 Subject: [PATCH 14/39] add deployed url to readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 2754db156..c65348b10 100644 --- a/README.md +++ b/README.md @@ -8,3 +8,4 @@ Danebook A project for [Viking Code School](http://vikingcodeschool.com) +Click here for [deployed version](https://serene-eyrie-68941.herokuapp.com/) \ No newline at end of file From 389a966a252035381af64f7133caa47e0da09832 Mon Sep 17 00:00:00 2001 From: David Jiang Date: Mon, 15 Aug 2016 15:20:06 -0700 Subject: [PATCH 15/39] added model tests --- .rspec | 2 + Gemfile | 4 + Gemfile.lock | 59 +++++++++++ Guardfile | 70 +++++++++++++ app/models/like.rb | 4 +- app/models/user.rb | 1 + spec/factories/comment_factory.rb | 7 ++ spec/factories/like_factory.rb | 14 +++ spec/factories/post_factory.rb | 6 ++ spec/factories/profile_factory.rb | 9 ++ spec/factories/user_factory.rb | 6 ++ spec/models/comment_spec.rb | 27 +++++ spec/models/like_spec.rb | 56 +++++++++++ spec/models/post_spec.rb | 24 +++++ spec/models/profile_spec.rb | 32 ++++++ spec/models/user_spec.rb | 59 +++++++++++ spec/rails_helper.rb | 65 ++++++++++++ spec/spec_helper.rb | 99 +++++++++++++++++++ test/controllers/.keep | 0 test/controllers/comments_controller_test.rb | 7 -- test/controllers/likes_controller_test.rb | 7 -- test/controllers/posts_controller_test.rb | 7 -- test/controllers/sessions_controller_test.rb | 7 -- .../static_pages_controller_test.rb | 7 -- test/controllers/users_controller_test.rb | 7 -- test/fixtures/.keep | 0 test/fixtures/comments.yml | 11 --- test/fixtures/files/.keep | 0 test/fixtures/likes.yml | 11 --- test/fixtures/posts.yml | 11 --- test/fixtures/profiles.yml | 11 --- test/fixtures/users.yml | 11 --- test/helpers/.keep | 0 test/integration/.keep | 0 test/mailers/.keep | 0 test/models/.keep | 0 test/models/comment_test.rb | 7 -- test/models/like_test.rb | 7 -- test/models/post_test.rb | 7 -- test/models/profile_test.rb | 7 -- test/models/user_test.rb | 7 -- test/test_helper.rb | 10 -- 42 files changed, 542 insertions(+), 144 deletions(-) create mode 100644 .rspec create mode 100644 Guardfile create mode 100644 spec/factories/comment_factory.rb create mode 100644 spec/factories/like_factory.rb create mode 100644 spec/factories/post_factory.rb create mode 100644 spec/factories/profile_factory.rb create mode 100644 spec/factories/user_factory.rb create mode 100644 spec/models/comment_spec.rb create mode 100644 spec/models/like_spec.rb create mode 100644 spec/models/post_spec.rb create mode 100644 spec/models/profile_spec.rb create mode 100644 spec/models/user_spec.rb create mode 100644 spec/rails_helper.rb create mode 100644 spec/spec_helper.rb delete mode 100644 test/controllers/.keep delete mode 100644 test/controllers/comments_controller_test.rb delete mode 100644 test/controllers/likes_controller_test.rb delete mode 100644 test/controllers/posts_controller_test.rb delete mode 100644 test/controllers/sessions_controller_test.rb delete mode 100644 test/controllers/static_pages_controller_test.rb delete mode 100644 test/controllers/users_controller_test.rb delete mode 100644 test/fixtures/.keep delete mode 100644 test/fixtures/comments.yml delete mode 100644 test/fixtures/files/.keep delete mode 100644 test/fixtures/likes.yml delete mode 100644 test/fixtures/posts.yml delete mode 100644 test/fixtures/profiles.yml delete mode 100644 test/fixtures/users.yml delete mode 100644 test/helpers/.keep delete mode 100644 test/integration/.keep delete mode 100644 test/mailers/.keep delete mode 100644 test/models/.keep delete mode 100644 test/models/comment_test.rb delete mode 100644 test/models/like_test.rb delete mode 100644 test/models/post_test.rb delete mode 100644 test/models/profile_test.rb delete mode 100644 test/models/user_test.rb delete mode 100644 test/test_helper.rb diff --git a/.rspec b/.rspec new file mode 100644 index 000000000..83e16f804 --- /dev/null +++ b/.rspec @@ -0,0 +1,2 @@ +--color +--require spec_helper diff --git a/Gemfile b/Gemfile index 017e50612..5b01d5e46 100644 --- a/Gemfile +++ b/Gemfile @@ -38,6 +38,9 @@ group :development, :test do gem 'byebug', platform: :mri # Use sqlite3 as the database for Active Record gem 'sqlite3' + gem 'rspec-rails' + gem 'factory_girl_rails', '~> 4.0' + gem 'shoulda-matchers', '~> 3.1' end group :development do @@ -49,6 +52,7 @@ group :development do gem 'spring-watcher-listen', '~> 2.0.0' gem 'better_errors' gem 'binding_of_caller' + gem 'guard-rspec', require: false end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem diff --git a/Gemfile.lock b/Gemfile.lock index 08bc7eba6..c1785edce 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -58,11 +58,32 @@ GEM coffee-script-source (1.10.0) concurrent-ruby (1.0.2) debug_inspector (0.0.2) + diff-lcs (1.2.5) erubis (2.7.0) execjs (2.7.0) + factory_girl (4.5.0) + activesupport (>= 3.0.0) + factory_girl_rails (4.6.0) + factory_girl (~> 4.5.0) + railties (>= 3.0.0) ffi (1.9.14) + formatador (0.2.5) globalid (0.3.7) activesupport (>= 4.1.0) + guard (2.14.0) + formatador (>= 0.2.4) + listen (>= 2.7, < 4.0) + lumberjack (~> 1.0) + nenv (~> 0.1) + notiffany (~> 0.0) + pry (>= 0.9.12) + shellany (~> 0.0) + thor (>= 0.18.1) + guard-compat (1.2.1) + guard-rspec (4.7.2) + guard (~> 2.1) + guard-compat (~> 1.1) + rspec (>= 2.99.0, < 4.0) i18n (0.7.0) jbuilder (2.6.0) activesupport (>= 3.0.0, < 5.1) @@ -76,6 +97,7 @@ GEM rb-inotify (~> 0.9, >= 0.9.7) loofah (2.0.3) nokogiri (>= 1.5.9) + lumberjack (1.0.10) mail (2.6.4) mime-types (>= 1.16, < 4) method_source (0.8.2) @@ -85,12 +107,20 @@ GEM mini_portile2 (2.1.0) minitest (5.9.0) multi_json (1.12.1) + nenv (0.3.0) nio4r (1.2.1) nokogiri (1.6.8) mini_portile2 (~> 2.1.0) pkg-config (~> 1.1.7) + notiffany (0.1.0) + nenv (~> 0.1) + shellany (~> 0.0) pg (0.18.4) pkg-config (1.1.7) + pry (0.10.4) + coderay (~> 1.1.0) + method_source (~> 0.8.1) + slop (~> 3.4) puma (3.6.0) rack (2.0.1) rack-test (0.6.3) @@ -127,6 +157,27 @@ GEM rb-fsevent (0.9.7) rb-inotify (0.9.7) ffi (>= 0.5.0) + rspec (3.5.0) + rspec-core (~> 3.5.0) + rspec-expectations (~> 3.5.0) + rspec-mocks (~> 3.5.0) + rspec-core (3.5.2) + rspec-support (~> 3.5.0) + rspec-expectations (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-mocks (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-rails (3.5.1) + actionpack (>= 3.0) + activesupport (>= 3.0) + railties (>= 3.0) + rspec-core (~> 3.5.0) + rspec-expectations (~> 3.5.0) + rspec-mocks (~> 3.5.0) + rspec-support (~> 3.5.0) + rspec-support (3.5.0) sass (3.4.22) sass-rails (5.0.6) railties (>= 4.0.0, < 6) @@ -134,6 +185,10 @@ GEM sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) tilt (>= 1.1, < 3) + shellany (0.0.1) + shoulda-matchers (3.1.1) + activesupport (>= 4.0.0) + slop (3.6.0) spring (1.7.2) spring-watcher-listen (2.0.0) listen (>= 2.7, < 4.0) @@ -174,6 +229,8 @@ DEPENDENCIES binding_of_caller byebug coffee-rails (~> 4.2) + factory_girl_rails (~> 4.0) + guard-rspec jbuilder (~> 2.5) jquery-rails listen (~> 3.0.5) @@ -181,7 +238,9 @@ DEPENDENCIES puma (~> 3.0) rails (~> 5.0.0) rails_12factor + rspec-rails sass-rails (~> 5.0) + shoulda-matchers (~> 3.1) spring spring-watcher-listen (~> 2.0.0) sqlite3 diff --git a/Guardfile b/Guardfile new file mode 100644 index 000000000..3215f0137 --- /dev/null +++ b/Guardfile @@ -0,0 +1,70 @@ +# A sample Guardfile +# More info at https://github.com/guard/guard#readme + +## Uncomment and set this to only include directories you want to watch +# directories %w(app lib config test spec features) \ +# .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")} + +## Note: if you are using the `directories` clause above and you are not +## watching the project directory ('.'), then you will want to move +## the Guardfile to a watched dir and symlink it back, e.g. +# +# $ mkdir config +# $ mv Guardfile config/ +# $ ln -s config/Guardfile . +# +# and, you'll have to watch "config/Guardfile" instead of "Guardfile" + +# Note: The cmd option is now required due to the increasing number of ways +# rspec may be run, below are examples of the most common uses. +# * bundler: 'bundle exec rspec' +# * bundler binstubs: 'bin/rspec' +# * spring: 'bin/rspec' (This will use spring if running and you have +# installed the spring binstubs per the docs) +# * zeus: 'zeus rspec' (requires the server to be started separately) +# * 'just' rspec: 'rspec' + +guard :rspec, cmd: "bundle exec rspec" do + require "guard/rspec/dsl" + dsl = Guard::RSpec::Dsl.new(self) + + # Feel free to open issues for suggestions and improvements + + # RSpec files + rspec = dsl.rspec + watch(rspec.spec_helper) { rspec.spec_dir } + watch(rspec.spec_support) { rspec.spec_dir } + watch(rspec.spec_files) + + # Ruby files + ruby = dsl.ruby + dsl.watch_spec_files_for(ruby.lib_files) + + # Rails files + rails = dsl.rails(view_extensions: %w(erb haml slim)) + dsl.watch_spec_files_for(rails.app_files) + dsl.watch_spec_files_for(rails.views) + + watch(rails.controllers) do |m| + [ + rspec.spec.call("routing/#{m[1]}_routing"), + rspec.spec.call("controllers/#{m[1]}_controller"), + rspec.spec.call("acceptance/#{m[1]}") + ] + end + + # Rails config changes + watch(rails.spec_helper) { rspec.spec_dir } + watch(rails.routes) { "#{rspec.spec_dir}/routing" } + watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" } + + # Capybara features specs + watch(rails.view_dirs) { |m| rspec.spec.call("features/#{m[1]}") } + watch(rails.layouts) { |m| rspec.spec.call("features/#{m[1]}") } + + # Turnip features and steps + watch(%r{^spec/acceptance/(.+)\.feature$}) + watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m| + Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance" + end +end diff --git a/app/models/like.rb b/app/models/like.rb index b26fe5ede..b2083416b 100644 --- a/app/models/like.rb +++ b/app/models/like.rb @@ -1,6 +1,6 @@ class Like < ApplicationRecord belongs_to :likeable, polymorphic: true belongs_to :user - # a user can only like a particular post once - #validates :user_id, uniqueness: {:scope => [:post_id]} + # a user can only like a particular post or comment once + validates :user_id, uniqueness: {:scope => [:likeable_id, :likeable_type]} end diff --git a/app/models/user.rb b/app/models/user.rb index 3a6374648..f12a399b8 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -6,6 +6,7 @@ class User < ApplicationRecord :length => {:in => 8..24}, :allow_nil => true + validates :email, :uniqueness => true validates_format_of :email, :with => /@/ has_one :profile, inverse_of: :user diff --git a/spec/factories/comment_factory.rb b/spec/factories/comment_factory.rb new file mode 100644 index 000000000..a113f77d7 --- /dev/null +++ b/spec/factories/comment_factory.rb @@ -0,0 +1,7 @@ +FactoryGirl.define do + factory :comment do + body "This is a post" + user + post + end +end \ No newline at end of file diff --git a/spec/factories/like_factory.rb b/spec/factories/like_factory.rb new file mode 100644 index 000000000..a681003cf --- /dev/null +++ b/spec/factories/like_factory.rb @@ -0,0 +1,14 @@ +FactoryGirl.define do + factory :like do + user + + trait :on_post do + association :likeable, factory: :post + end + + trait :on_comment do + association :likeable, factory: :comment + end + + end +end \ No newline at end of file diff --git a/spec/factories/post_factory.rb b/spec/factories/post_factory.rb new file mode 100644 index 000000000..bcb912626 --- /dev/null +++ b/spec/factories/post_factory.rb @@ -0,0 +1,6 @@ +FactoryGirl.define do + factory :post do + body "This is a post" + user + end +end diff --git a/spec/factories/profile_factory.rb b/spec/factories/profile_factory.rb new file mode 100644 index 000000000..31358f3c1 --- /dev/null +++ b/spec/factories/profile_factory.rb @@ -0,0 +1,9 @@ +FactoryGirl.define do + factory :profile do + first_name "Harry" + last_name "Potter" + gender "Male" + birthday "1993-11-09" + user + end +end \ No newline at end of file diff --git a/spec/factories/user_factory.rb b/spec/factories/user_factory.rb new file mode 100644 index 000000000..9d906ccc2 --- /dev/null +++ b/spec/factories/user_factory.rb @@ -0,0 +1,6 @@ +FactoryGirl.define do + factory :user do + sequence(:email){ |n| "email#{n}@email.com"} + password "password" + end +end \ No newline at end of file diff --git a/spec/models/comment_spec.rb b/spec/models/comment_spec.rb new file mode 100644 index 000000000..e58a19357 --- /dev/null +++ b/spec/models/comment_spec.rb @@ -0,0 +1,27 @@ +require 'rails_helper' + +describe Comment do + let(:comment){ build(:comment) } + + it "is valid with default attributes" do + expect(comment).to be_valid + end + + it "is not valid with an empty body" do + bad_comment = build(:comment, body: "") + expect(bad_comment).not_to be_valid + end + + it {should have_many(:likes)} + + it {should belong_to(:post) } + it {should belong_to(:user) } + + describe "#posted_date" do + it "returns the date with day of the week" do + comment.save + expect(comment.posted_date).to eq("Monday 08/15/2016") + end + end + +end \ No newline at end of file diff --git a/spec/models/like_spec.rb b/spec/models/like_spec.rb new file mode 100644 index 000000000..a17637175 --- /dev/null +++ b/spec/models/like_spec.rb @@ -0,0 +1,56 @@ +require 'rails_helper' + +describe Like do + let(:post_like){ create(:like, :on_post)} + let(:comment_like){ create(:like, :on_comment) } + + it "is valid on a post" do + expect(post_like).to be_valid + end + + it "is valid on a comment" do + expect(comment_like).to be_valid + end + + specify "parents respond to their child associations" do + expect(post_like.likeable).to respond_to(:likes) + expect(comment_like.likeable).to respond_to(:likes) + end + + it{ should belong_to(:likeable) } + + it{ should belong_to (:user) } + + context "when a user likes a post" do + it "should not be allowed to like the same post" do + like = create(:like, :on_post) + user = like.user + post = like.likeable + another_like = build(:like, likeable: post, user: user) + expect(another_like).not_to be_valid + end + it "should be allowed to like another post" do + like = create(:like, :on_post) + user = like.user + another_like = build(:like, :on_post, user:user) + expect(another_like).to be_valid + end +end + + context "when a user likes a comment" do + it "should not be allowed to like the same comment" do + like = create(:like, :on_comment) + user = like.user + comment = like.likeable + another_like = build(:like, likeable: comment, user: user) + expect(another_like).not_to be_valid + end + it "should be allowed to like another comment" do + like = create(:like, :on_comment) + user = like.user + another_like = build(:like, :on_comment, user:user) + expect(another_like).to be_valid + end +end + +end \ No newline at end of file diff --git a/spec/models/post_spec.rb b/spec/models/post_spec.rb new file mode 100644 index 000000000..a9c5b6452 --- /dev/null +++ b/spec/models/post_spec.rb @@ -0,0 +1,24 @@ +require 'rails_helper' + +describe Post do + let (:post){ build(:post)} + + it "is valid with default attributes" do + expect(post).to be_valid + end + + it "is not valid with an empty body" do + bad_post = build(:post, body: "") + expect(bad_post).not_to be_valid + end + + it {should have_many(:likes)} + + describe "#posted_date" do + it "returns the date with day of the week" do + post.save + expect(post.posted_date).to eq("Monday 08/15/2016") + end + end + +end \ No newline at end of file diff --git a/spec/models/profile_spec.rb b/spec/models/profile_spec.rb new file mode 100644 index 000000000..20f147d33 --- /dev/null +++ b/spec/models/profile_spec.rb @@ -0,0 +1,32 @@ +require 'rails_helper' + +describe Profile do + let(:profile){ build(:profile) } + + it "is valid with default attributes" do + expect(profile).to be_valid + end + + it "is invalid to have no first name" do + bad_profile = build(:profile, first_name: "") + expect(bad_profile).not_to be_valid + end + + it "is invalid to have no last name" do + bad_profile = build(:profile, last_name: "") + expect(bad_profile).not_to be_valid + end + + it "is invalid to have no first or last name" do + bad_profile = build(:profile, first_name: "", last_name: "") + expect(bad_profile).not_to be_valid + end + + it{ should belong_to(:user).inverse_of(:profile) } + + describe "#full_name" do + it "returns the full name" do + expect(profile.full_name).to eq("Harry Potter") + end + end +end \ No newline at end of file diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb new file mode 100644 index 000000000..b0ae91f37 --- /dev/null +++ b/spec/models/user_spec.rb @@ -0,0 +1,59 @@ +require 'rails_helper' + +describe User do + let(:user){ build(:user) } + + it { is_expected.to have_secure_password } + + it "is valid with default attributes" do + expect(user).to be_valid + end + + describe "attribute validations" do + + it "doesn't allow passwords that are too short" do + user = build(:user, password: "123") + expect { user.save! }.to raise_error(ActiveRecord::RecordInvalid) + end + + it "doesn't allow passwords that are too long" do + user = build(:user, password: "1234567891011121314151617181920s") + expect { user.save! }.to raise_error(ActiveRecord::RecordInvalid) + end + + it "allows edge case passwords" do + user = build(:user, password: "This password is 24 char") + expect{ user.save! }.to_not raise_error + end + + it "validates email format" do + user = build(:user, email: "email.com") + expect{ user.save! }.to raise_error(ActiveRecord::RecordInvalid) + end + + context "when saving multiple users" do + before do + user.save! + end + it "doesn't allow identical email addresses" do + new_user = build(:user, :email => user.email) + expect{ new_user.save! }.to raise_error(ActiveRecord::RecordInvalid) + end + end + end + + describe "associations" do + it "responds to the posts association" do + expect(user).to respond_to(:posts) + end + + it "responds to the likes association" do + expect(user).to respond_to(:likes) + end + + it "responds to the comments association" do + expect(user).to respond_to(:comments) + end + end + +end \ No newline at end of file diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb new file mode 100644 index 000000000..5e2888f53 --- /dev/null +++ b/spec/rails_helper.rb @@ -0,0 +1,65 @@ +require 'factory_girl_rails' +# This file is copied to spec/ when you run 'rails generate rspec:install' +ENV['RAILS_ENV'] ||= 'test' +require File.expand_path('../../config/environment', __FILE__) +# Prevent database truncation if the environment is production +abort("The Rails environment is running in production mode!") if Rails.env.production? +require 'spec_helper' +require 'rspec/rails' +# Add additional requires below this line. Rails is not loaded until this point! + +# Requires supporting ruby files with custom matchers and macros, etc, in +# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are +# run as spec files by default. This means that files in spec/support that end +# in _spec.rb will both be required and run as specs, causing the specs to be +# run twice. It is recommended that you do not name files matching this glob to +# end with _spec.rb. You can configure this pattern with the --pattern +# option on the command line or in ~/.rspec, .rspec or `.rspec-local`. +# +# The following line is provided for convenience purposes. It has the downside +# of increasing the boot-up time by auto-requiring all files in the support +# directory. Alternatively, in the individual `*_spec.rb` files, manually +# require only the support files necessary. +# +# Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f } + +# Checks for pending migration and applies them before tests are run. +# If you are not using ActiveRecord, you can remove this line. +ActiveRecord::Migration.maintain_test_schema! + +RSpec.configure do |config| + # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures + config.fixture_path = "#{::Rails.root}/spec/fixtures" + config.include FactoryGirl::Syntax::Methods + # If you're not using ActiveRecord, or you'd prefer not to run each of your + # examples within a transaction, remove the following line or assign false + # instead of true. + config.use_transactional_fixtures = true + + # RSpec Rails can automatically mix in different behaviours to your tests + # based on their file location, for example enabling you to call `get` and + # `post` in specs under `spec/controllers`. + # + # You can disable this behaviour by removing the line below, and instead + # explicitly tag your specs with their type, e.g.: + # + # RSpec.describe UsersController, :type => :controller do + # # ... + # end + # + # The different available types are documented in the features, such as in + # https://relishapp.com/rspec/rspec-rails/docs + config.infer_spec_type_from_file_location! + + # Filter lines from Rails gems in backtraces. + config.filter_rails_from_backtrace! + # arbitrary gems may also be filtered via: + # config.filter_gems_from_backtrace("gem name") +end + +Shoulda::Matchers.configure do |config| + config.integrate do |with| + with.test_framework :rspec + with.library :rails + end +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 000000000..8f698be46 --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,99 @@ +# This file was generated by the `rails generate rspec:install` command. Conventionally, all +# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. +# The generated `.rspec` file contains `--require spec_helper` which will cause +# this file to always be loaded, without a need to explicitly require it in any +# files. +# +# Given that it is always loaded, you are encouraged to keep this file as +# light-weight as possible. Requiring heavyweight dependencies from this file +# will add to the boot time of your test suite on EVERY test run, even for an +# individual file that may not need all of that loaded. Instead, consider making +# a separate helper file that requires the additional dependencies and performs +# the additional setup, and require it from the spec files that actually need +# it. +# +# The `.rspec` file also contains a few flags that are not defaults but that +# users commonly want. +# +# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration +RSpec.configure do |config| + # rspec-expectations config goes here. You can use an alternate + # assertion/expectation library such as wrong or the stdlib/minitest + # assertions if you prefer. + config.expect_with :rspec do |expectations| + # This option will default to `true` in RSpec 4. It makes the `description` + # and `failure_message` of custom matchers include text for helper methods + # defined using `chain`, e.g.: + # be_bigger_than(2).and_smaller_than(4).description + # # => "be bigger than 2 and smaller than 4" + # ...rather than: + # # => "be bigger than 2" + expectations.include_chain_clauses_in_custom_matcher_descriptions = true + end + + # rspec-mocks config goes here. You can use an alternate test double + # library (such as bogus or mocha) by changing the `mock_with` option here. + config.mock_with :rspec do |mocks| + # Prevents you from mocking or stubbing a method that does not exist on + # a real object. This is generally recommended, and will default to + # `true` in RSpec 4. + mocks.verify_partial_doubles = true + end + + # This option will default to `:apply_to_host_groups` in RSpec 4 (and will + # have no way to turn it off -- the option exists only for backwards + # compatibility in RSpec 3). It causes shared context metadata to be + # inherited by the metadata hash of host groups and examples, rather than + # triggering implicit auto-inclusion in groups with matching metadata. + config.shared_context_metadata_behavior = :apply_to_host_groups + +# The settings below are suggested to provide a good initial experience +# with RSpec, but feel free to customize to your heart's content. +=begin + # This allows you to limit a spec run to individual examples or groups + # you care about by tagging them with `:focus` metadata. When nothing + # is tagged with `:focus`, all examples get run. RSpec also provides + # aliases for `it`, `describe`, and `context` that include `:focus` + # metadata: `fit`, `fdescribe` and `fcontext`, respectively. + config.filter_run_when_matching :focus + + # Allows RSpec to persist some state between runs in order to support + # the `--only-failures` and `--next-failure` CLI options. We recommend + # you configure your source control system to ignore this file. + config.example_status_persistence_file_path = "spec/examples.txt" + + # Limits the available syntax to the non-monkey patched syntax that is + # recommended. For more details, see: + # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/ + # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ + # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode + config.disable_monkey_patching! + + # Many RSpec users commonly either run the entire suite or an individual + # file, and it's useful to allow more verbose output when running an + # individual spec file. + if config.files_to_run.one? + # Use the documentation formatter for detailed output, + # unless a formatter has already been configured + # (e.g. via a command-line flag). + config.default_formatter = 'doc' + end + + # Print the 10 slowest examples and example groups at the + # end of the spec run, to help surface which specs are running + # particularly slow. + config.profile_examples = 10 + + # Run specs in random order to surface order dependencies. If you find an + # order dependency and want to debug it, you can fix the order by providing + # the seed, which is printed after each run. + # --seed 1234 + config.order = :random + + # Seed global randomization in this process using the `--seed` CLI option. + # Setting this allows you to use `--seed` to deterministically reproduce + # test failures related to randomization by passing the same `--seed` value + # as the one that triggered the failure. + Kernel.srand config.seed +=end +end diff --git a/test/controllers/.keep b/test/controllers/.keep deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/controllers/comments_controller_test.rb b/test/controllers/comments_controller_test.rb deleted file mode 100644 index a812ddae9..000000000 --- a/test/controllers/comments_controller_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class CommentsControllerTest < ActionDispatch::IntegrationTest - # test "the truth" do - # assert true - # end -end diff --git a/test/controllers/likes_controller_test.rb b/test/controllers/likes_controller_test.rb deleted file mode 100644 index 78e007545..000000000 --- a/test/controllers/likes_controller_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class LikesControllerTest < ActionDispatch::IntegrationTest - # test "the truth" do - # assert true - # end -end diff --git a/test/controllers/posts_controller_test.rb b/test/controllers/posts_controller_test.rb deleted file mode 100644 index 12c4a7fd0..000000000 --- a/test/controllers/posts_controller_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class PostsControllerTest < ActionDispatch::IntegrationTest - # test "the truth" do - # assert true - # end -end diff --git a/test/controllers/sessions_controller_test.rb b/test/controllers/sessions_controller_test.rb deleted file mode 100644 index 6135ce6af..000000000 --- a/test/controllers/sessions_controller_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class SessionsControllerTest < ActionDispatch::IntegrationTest - # test "the truth" do - # assert true - # end -end diff --git a/test/controllers/static_pages_controller_test.rb b/test/controllers/static_pages_controller_test.rb deleted file mode 100644 index 76b4b38eb..000000000 --- a/test/controllers/static_pages_controller_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class StaticPagesControllerTest < ActionDispatch::IntegrationTest - # test "the truth" do - # assert true - # end -end diff --git a/test/controllers/users_controller_test.rb b/test/controllers/users_controller_test.rb deleted file mode 100644 index 6c3da770c..000000000 --- a/test/controllers/users_controller_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class UsersControllerTest < ActionDispatch::IntegrationTest - # test "the truth" do - # assert true - # end -end diff --git a/test/fixtures/.keep b/test/fixtures/.keep deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/fixtures/comments.yml b/test/fixtures/comments.yml deleted file mode 100644 index 80aed36e3..000000000 --- a/test/fixtures/comments.yml +++ /dev/null @@ -1,11 +0,0 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -# This model initially had no columns defined. If you add columns to the -# model remove the '{}' from the fixture names and add the columns immediately -# below each fixture, per the syntax in the comments below -# -one: {} -# column: value -# -two: {} -# column: value diff --git a/test/fixtures/files/.keep b/test/fixtures/files/.keep deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/fixtures/likes.yml b/test/fixtures/likes.yml deleted file mode 100644 index 80aed36e3..000000000 --- a/test/fixtures/likes.yml +++ /dev/null @@ -1,11 +0,0 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -# This model initially had no columns defined. If you add columns to the -# model remove the '{}' from the fixture names and add the columns immediately -# below each fixture, per the syntax in the comments below -# -one: {} -# column: value -# -two: {} -# column: value diff --git a/test/fixtures/posts.yml b/test/fixtures/posts.yml deleted file mode 100644 index 80aed36e3..000000000 --- a/test/fixtures/posts.yml +++ /dev/null @@ -1,11 +0,0 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -# This model initially had no columns defined. If you add columns to the -# model remove the '{}' from the fixture names and add the columns immediately -# below each fixture, per the syntax in the comments below -# -one: {} -# column: value -# -two: {} -# column: value diff --git a/test/fixtures/profiles.yml b/test/fixtures/profiles.yml deleted file mode 100644 index 80aed36e3..000000000 --- a/test/fixtures/profiles.yml +++ /dev/null @@ -1,11 +0,0 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -# This model initially had no columns defined. If you add columns to the -# model remove the '{}' from the fixture names and add the columns immediately -# below each fixture, per the syntax in the comments below -# -one: {} -# column: value -# -two: {} -# column: value diff --git a/test/fixtures/users.yml b/test/fixtures/users.yml deleted file mode 100644 index 80aed36e3..000000000 --- a/test/fixtures/users.yml +++ /dev/null @@ -1,11 +0,0 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -# This model initially had no columns defined. If you add columns to the -# model remove the '{}' from the fixture names and add the columns immediately -# below each fixture, per the syntax in the comments below -# -one: {} -# column: value -# -two: {} -# column: value diff --git a/test/helpers/.keep b/test/helpers/.keep deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/integration/.keep b/test/integration/.keep deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/mailers/.keep b/test/mailers/.keep deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/models/.keep b/test/models/.keep deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/models/comment_test.rb b/test/models/comment_test.rb deleted file mode 100644 index b6d6131a9..000000000 --- a/test/models/comment_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class CommentTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/test/models/like_test.rb b/test/models/like_test.rb deleted file mode 100644 index 1eea9915b..000000000 --- a/test/models/like_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class LikeTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/test/models/post_test.rb b/test/models/post_test.rb deleted file mode 100644 index 6d9d463a7..000000000 --- a/test/models/post_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class PostTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/test/models/profile_test.rb b/test/models/profile_test.rb deleted file mode 100644 index 3dfa94302..000000000 --- a/test/models/profile_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class ProfileTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/test/models/user_test.rb b/test/models/user_test.rb deleted file mode 100644 index 82f61e010..000000000 --- a/test/models/user_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class UserTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/test/test_helper.rb b/test/test_helper.rb deleted file mode 100644 index 92e39b2d7..000000000 --- a/test/test_helper.rb +++ /dev/null @@ -1,10 +0,0 @@ -ENV['RAILS_ENV'] ||= 'test' -require File.expand_path('../../config/environment', __FILE__) -require 'rails/test_help' - -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 From e0a89c48476091097c14da9b80bea60cd3cea30f Mon Sep 17 00:00:00 2001 From: David Jiang Date: Mon, 15 Aug 2016 18:23:50 -0700 Subject: [PATCH 16/39] friending and friends page --- app/assets/javascripts/friendings.coffee | 3 + app/assets/stylesheets/friendings.scss | 3 + app/controllers/friendings_controller.rb | 19 ++++++ app/controllers/users_controller.rb | 5 ++ app/helpers/friendings_helper.rb | 2 + app/models/friending.rb | 8 +++ app/models/user.rb | 12 ++++ app/views/posts/_timeline_top.html.erb | 58 ++++++++--------- app/views/static_pages/_middle_nav.html.erb | 11 +++- app/views/users/friends.html.erb | 63 +++++++++++++++++++ config/routes.rb | 6 +- .../20160815223000_create_friendings.rb | 10 +++ db/schema.rb | 10 ++- .../controllers/friendings_controller_spec.rb | 5 ++ spec/factories/friendings.rb | 5 ++ spec/helpers/friendings_helper_spec.rb | 15 +++++ spec/models/friending_spec.rb | 5 ++ 17 files changed, 209 insertions(+), 31 deletions(-) create mode 100644 app/assets/javascripts/friendings.coffee create mode 100644 app/assets/stylesheets/friendings.scss create mode 100644 app/controllers/friendings_controller.rb create mode 100644 app/helpers/friendings_helper.rb create mode 100644 app/models/friending.rb create mode 100644 app/views/users/friends.html.erb create mode 100644 db/migrate/20160815223000_create_friendings.rb create mode 100644 spec/controllers/friendings_controller_spec.rb create mode 100644 spec/factories/friendings.rb create mode 100644 spec/helpers/friendings_helper_spec.rb create mode 100644 spec/models/friending_spec.rb diff --git a/app/assets/javascripts/friendings.coffee b/app/assets/javascripts/friendings.coffee new file mode 100644 index 000000000..24f83d18b --- /dev/null +++ b/app/assets/javascripts/friendings.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/friendings.scss b/app/assets/stylesheets/friendings.scss new file mode 100644 index 000000000..b93309da3 --- /dev/null +++ b/app/assets/stylesheets/friendings.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the Friendings controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/friendings_controller.rb b/app/controllers/friendings_controller.rb new file mode 100644 index 000000000..3468f36d3 --- /dev/null +++ b/app/controllers/friendings_controller.rb @@ -0,0 +1,19 @@ +class FriendingsController < ApplicationController + + def create + friending_recipient = User.find(params[:id]) + + if current_user.friended_users << friending_recipient + redirect_to user_posts_path(friending_recipient) + else + redirect_to friending_recipient + end + end + + def destroy + user_to_unfriend = User.find(params[:id]) + current_user.friended_users.delete(user_to_unfriend) + redirect_to current_user + end + +end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 905523875..88350fa19 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -40,6 +40,11 @@ def update end end + def friends + @user = User.find(params[:id]) + @profile = @user.profile + end + private def user_params diff --git a/app/helpers/friendings_helper.rb b/app/helpers/friendings_helper.rb new file mode 100644 index 000000000..fce356995 --- /dev/null +++ b/app/helpers/friendings_helper.rb @@ -0,0 +1,2 @@ +module FriendingsHelper +end diff --git a/app/models/friending.rb b/app/models/friending.rb new file mode 100644 index 000000000..d7dd52a43 --- /dev/null +++ b/app/models/friending.rb @@ -0,0 +1,8 @@ +class Friending < ApplicationRecord + #Initiator side + belongs_to :friend_initiator, :foreign_key => :friender_id, :class_name => "User" + #Recipient side + belongs_to :friend_recipient, :foreign_key => :friend_id, :class_name => "User" + + validates :friend_id, :uniqueness => {:scope=>:friender_id} +end diff --git a/app/models/user.rb b/app/models/user.rb index f12a399b8..84605c8f6 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -17,6 +17,14 @@ class User < ApplicationRecord has_many :likes has_many :comments + #when friending someone + has_many :initiated_friendings, :foreign_key => :friender_id, :class_name => "Friending" + has_many :friended_users, :through => :initiated_friendings, :source => :friend_recipient + + #when receiving a friending + has_many :received_friendings, :foreign_key => :friend_id, :class_name => "Friending" + has_many :users_friended_by, :through => :received_friendings, :source => :friend_initiator + def generate_token begin self[:auth_token] = SecureRandom.urlsafe_base64 @@ -29,4 +37,8 @@ def regenerate_auth_token save! end + def name + profile.first_name + end + end diff --git a/app/views/posts/_timeline_top.html.erb b/app/views/posts/_timeline_top.html.erb index db92f5a09..b1aeb2de7 100644 --- a/app/views/posts/_timeline_top.html.erb +++ b/app/views/posts/_timeline_top.html.erb @@ -106,43 +106,45 @@
-

Friends (542)

+

Friends (<%= user.friended_users.count %>)

+ -
- -
- <%= image_tag "wizard_hat.png", alt:"photo", class: "img-responsive" %> - + <% user.friended_users.each_with_index do |friend, idx| %> + + <% if idx == 0 || idx == 3 %> +
+
+ <%= image_tag "wizard_hat.png", alt:"photo", class: "img-responsive" %> + <%= link_to friend.profile.full_name, friend, class: "btn btn-link wrap-text" %> +
+ + <% elsif idx == 2 || idx == 5 %> +
+ <%= image_tag "wizard_hat.png", alt:"photo", class: "img-responsive" %> + <%= link_to friend.profile.full_name, friend, class: "btn btn-link wrap-text" %> +
- -
- - + <% end %> + <% end %> + <% if user.friended_users.count > 6 %>
- +
+ <% end %>
diff --git a/app/views/static_pages/_middle_nav.html.erb b/app/views/static_pages/_middle_nav.html.erb index a5b0f8972..e48ea1dce 100644 --- a/app/views/static_pages/_middle_nav.html.erb +++ b/app/views/static_pages/_middle_nav.html.erb @@ -9,15 +9,24 @@ <%= link_to "About", user %> - +
+ <% unless page == 'about_edit' %>
<% if authorized_user? %> + <% else %> + <% if current_user.friended_users.pluck(:id).include?(user.id) %> + <%= link_to "Unfriend #{user.name}", friendings_path(:id => user.id), :method => "Delete", :class => "btn btn-link" %> + <% else %> + <%= link_to "Friend #{user.name}", friendings_path(:id => user.id), :method => "Post", :class => "btn btn-link" %> + <% end %> <% end %>
<% end %> diff --git a/app/views/users/friends.html.erb b/app/views/users/friends.html.erb new file mode 100644 index 000000000..2e85da717 --- /dev/null +++ b/app/views/users/friends.html.erb @@ -0,0 +1,63 @@ +
+ <%= render :partial => "static_pages/main_nav", :locals => {profile: @profile} %> + + <%= render :partial => "static_pages/main_photo", :locals=>{:profile=> @profile} %> + +
+
+ + +<%= render :partial => "static_pages/middle_nav", :locals => {:page=>"friends", :user => @user} %> + +
+
+
+
+ Friends +
+
+ + + +<% @user.friended_users.each_with_index do |friend, idx| %> + + <% if idx%2 == 0 %> + +
+
+
+ friends's picture +
+

<%= link_to friend.profile.full_name, friend %>

+

<%= friend.friended_users.count %> Friends

+
+ <% if authorized_user? %> + <%= link_to "Unfriend me", friendings_path(:id => friend.id), :method => "Delete", :class => "btn btn-default unfriend" %> + <% end %> +
+
+ <% if friend == @user.friended_users.last %> +
+ <% end %> + + <% else %> +
+
+
+ friends's picture +
+

<%= link_to friend.profile.full_name, friend %>

+

<%= friend.friended_users.count %> Friends

+
+ <% if authorized_user? %> + <%= link_to "Unfriend me", friendings_path(:id => friend.id), :method => "Delete", :class => "btn btn-default unfriend" %> + <% end %> +
+
+
+ <% end %> +<% end %> + +
+
+
\ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index d046efeab..58022b4aa 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,7 +1,7 @@ Rails.application.routes.draw do root "static_pages#home" get "timeline" => "static_pages#timeline" - get "friends" => "static_pages#friends" + #get "friends" => "static_pages#friends" get "about" => "static_pages#about" get "photos" => "static_pages#photos" get "about_edit" => "static_pages#about_edit" @@ -18,5 +18,9 @@ resource :session, :only => [:new, :create, :destroy] get "login" => "sessions#new" delete "logout" => "sessions#destroy" + + resource :friendings, :only => [:create, :destroy] + + get "friends" => "users#friends" # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html end diff --git a/db/migrate/20160815223000_create_friendings.rb b/db/migrate/20160815223000_create_friendings.rb new file mode 100644 index 000000000..7ca8d6785 --- /dev/null +++ b/db/migrate/20160815223000_create_friendings.rb @@ -0,0 +1,10 @@ +class CreateFriendings < ActiveRecord::Migration[5.0] + def change + create_table :friendings do |t| + t.integer :friender_id, :null => false + t.integer :friend_id, :null => false + t.timestamps + end + add_index :friendings, [:friend_id, :friender_id], :unique => true + end +end diff --git a/db/schema.rb b/db/schema.rb index c426ce1ae..bf9e89359 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: 20160813220529) do +ActiveRecord::Schema.define(version: 20160815223000) do create_table "comments", force: :cascade do |t| t.integer "user_id" @@ -20,6 +20,14 @@ t.datetime "updated_at", null: false end + create_table "friendings", force: :cascade do |t| + t.integer "friender_id", null: false + t.integer "friend_id", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["friend_id", "friender_id"], name: "index_friendings_on_friend_id_and_friender_id", unique: true + end + create_table "likes", force: :cascade do |t| t.integer "user_id" t.datetime "created_at", null: false diff --git a/spec/controllers/friendings_controller_spec.rb b/spec/controllers/friendings_controller_spec.rb new file mode 100644 index 000000000..55d19a900 --- /dev/null +++ b/spec/controllers/friendings_controller_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe FriendingsController, type: :controller do + +end diff --git a/spec/factories/friendings.rb b/spec/factories/friendings.rb new file mode 100644 index 000000000..024c1bfc6 --- /dev/null +++ b/spec/factories/friendings.rb @@ -0,0 +1,5 @@ +FactoryGirl.define do + factory :friending do + + end +end diff --git a/spec/helpers/friendings_helper_spec.rb b/spec/helpers/friendings_helper_spec.rb new file mode 100644 index 000000000..e8a5977d7 --- /dev/null +++ b/spec/helpers/friendings_helper_spec.rb @@ -0,0 +1,15 @@ +require 'rails_helper' + +# Specs in this file have access to a helper object that includes +# the FriendingsHelper. For example: +# +# describe FriendingsHelper do +# describe "string concat" do +# it "concats two strings with spaces" do +# expect(helper.concat_strings("this","that")).to eq("this that") +# end +# end +# end +RSpec.describe FriendingsHelper, type: :helper do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/models/friending_spec.rb b/spec/models/friending_spec.rb new file mode 100644 index 000000000..e5b208edf --- /dev/null +++ b/spec/models/friending_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe Friending, type: :model do + pending "add some examples to (or delete) #{__FILE__}" +end From e41974707cba8826dbdafcd5522f9f70fe29fba3 Mon Sep 17 00:00:00 2001 From: David Jiang Date: Wed, 17 Aug 2016 17:00:34 -0700 Subject: [PATCH 17/39] added tests and fixed friends box --- Gemfile | 7 + Gemfile.lock | 21 ++ app/assets/javascripts/friends.coffee | 3 + app/assets/stylesheets/friends.scss | 3 + app/controllers/comments_controller.rb | 2 +- app/controllers/friends_controller.rb | 7 + app/controllers/users_controller.rb | 8 +- app/helpers/friends_helper.rb | 2 + app/models/profile.rb | 12 + app/models/user.rb | 13 +- app/views/friends/index.html.erb | 63 ++++ app/views/posts/_timeline_top.html.erb | 273 +++++++++--------- app/views/static_pages/_middle_nav.html.erb | 2 +- app/views/static_pages/_sign_up_form.html.erb | 4 +- app/views/users/friends.html.erb | 1 + app/views/users/show.html.erb | 5 - config/routes.rb | 3 +- spec/controllers/comments_controller_spec.rb | 38 +++ spec/controllers/friends_controller_spec.rb | 5 + spec/controllers/likes_controller_spec.rb | 56 ++++ spec/controllers/posts_controller_spec.rb | 56 ++++ spec/controllers/users_controller_spec.rb | 56 ++++ spec/factories/comment_factory.rb | 2 +- spec/features/comments_spec.rb | 23 ++ spec/features/friends_spec.rb | 56 ++++ spec/features/likes_spec.rb | 23 ++ spec/features/posts_spec.rb | 41 +++ spec/features/users_spec.rb | 82 ++++++ spec/helpers/friends_helper_spec.rb | 15 + spec/rails_helper.rb | 6 +- spec/support/user_macros.rb | 27 ++ spec/views/friends/index_spec.rb | 36 +++ spec/views/posts/_timeline_top_spec.rb | 5 + 33 files changed, 801 insertions(+), 155 deletions(-) create mode 100644 app/assets/javascripts/friends.coffee create mode 100644 app/assets/stylesheets/friends.scss create mode 100644 app/controllers/friends_controller.rb create mode 100644 app/helpers/friends_helper.rb create mode 100644 app/views/friends/index.html.erb create mode 100644 spec/controllers/comments_controller_spec.rb create mode 100644 spec/controllers/friends_controller_spec.rb create mode 100644 spec/controllers/likes_controller_spec.rb create mode 100644 spec/controllers/posts_controller_spec.rb create mode 100644 spec/controllers/users_controller_spec.rb create mode 100644 spec/features/comments_spec.rb create mode 100644 spec/features/friends_spec.rb create mode 100644 spec/features/likes_spec.rb create mode 100644 spec/features/posts_spec.rb create mode 100644 spec/features/users_spec.rb create mode 100644 spec/helpers/friends_helper_spec.rb create mode 100644 spec/support/user_macros.rb create mode 100644 spec/views/friends/index_spec.rb create mode 100644 spec/views/posts/_timeline_top_spec.rb diff --git a/Gemfile b/Gemfile index 5b01d5e46..a7874ce94 100644 --- a/Gemfile +++ b/Gemfile @@ -33,6 +33,12 @@ group :production do gem 'pg' end +group :test do + gem 'capybara' + gem 'launchy' + gem 'rails-controller-testing' +end + group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem 'byebug', platform: :mri @@ -41,6 +47,7 @@ group :development, :test do gem 'rspec-rails' gem 'factory_girl_rails', '~> 4.0' gem 'shoulda-matchers', '~> 3.1' + gem 'hirb' end group :development do diff --git a/Gemfile.lock b/Gemfile.lock index c1785edce..f1e8680ab 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -38,6 +38,7 @@ GEM i18n (~> 0.7) minitest (~> 5.1) tzinfo (~> 1.1) + addressable (2.4.0) arel (7.1.1) bcrypt (3.1.11) better_errors (2.1.1) @@ -48,6 +49,13 @@ GEM debug_inspector (>= 0.0.1) builder (3.2.2) byebug (9.0.5) + capybara (2.7.1) + addressable + mime-types (>= 1.16) + nokogiri (>= 1.3.3) + rack (>= 1.0.0) + rack-test (>= 0.5.4) + xpath (~> 2.0) coderay (1.1.1) coffee-rails (4.2.1) coffee-script (>= 2.2.0) @@ -84,6 +92,7 @@ GEM guard (~> 2.1) guard-compat (~> 1.1) rspec (>= 2.99.0, < 4.0) + hirb (0.7.3) i18n (0.7.0) jbuilder (2.6.0) activesupport (>= 3.0.0, < 5.1) @@ -92,6 +101,8 @@ GEM rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) + launchy (2.4.3) + addressable (~> 2.3) listen (3.0.8) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) @@ -137,6 +148,10 @@ GEM bundler (>= 1.3.0, < 2.0) railties (= 5.0.0) sprockets-rails (>= 2.0.0) + rails-controller-testing (1.0.1) + actionpack (~> 5.x) + actionview (~> 5.x) + activesupport (~> 5.x) rails-dom-testing (2.0.1) activesupport (>= 4.2.0, < 6.0) nokogiri (~> 1.6.0) @@ -219,6 +234,8 @@ GEM websocket-driver (0.6.4) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.2) + xpath (2.0.0) + nokogiri (~> 1.3) PLATFORMS ruby @@ -228,15 +245,19 @@ DEPENDENCIES better_errors binding_of_caller byebug + capybara coffee-rails (~> 4.2) factory_girl_rails (~> 4.0) guard-rspec + hirb jbuilder (~> 2.5) jquery-rails + launchy listen (~> 3.0.5) pg puma (~> 3.0) rails (~> 5.0.0) + rails-controller-testing rails_12factor rspec-rails sass-rails (~> 5.0) diff --git a/app/assets/javascripts/friends.coffee b/app/assets/javascripts/friends.coffee new file mode 100644 index 000000000..24f83d18b --- /dev/null +++ b/app/assets/javascripts/friends.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/friends.scss b/app/assets/stylesheets/friends.scss new file mode 100644 index 000000000..8b8aa1c4d --- /dev/null +++ b/app/assets/stylesheets/friends.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the friends controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 1ead9000e..822aefb44 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -6,7 +6,7 @@ def create @comment = Comment.new(:post_id => params[:post_id].to_i, :user_id => current_user.id, :body => params[:comment][:body]) - if @comment.save! + if @comment.save redirect_to user_posts_path(@user) else redirect_to user_posts_path(@user) diff --git a/app/controllers/friends_controller.rb b/app/controllers/friends_controller.rb new file mode 100644 index 000000000..fa38dcaea --- /dev/null +++ b/app/controllers/friends_controller.rb @@ -0,0 +1,7 @@ +class FriendsController < ApplicationController + + def index + @user = User.find(params[:user_id]) + @profile = @user.profile + end +end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 88350fa19..3912e2a96 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,6 +1,9 @@ class UsersController < ApplicationController skip_before_action :require_login, :only => [:new, :create] before_action :require_authorized_user, :only => [:edit, :update, :destroy] + def index + redirect_to "static_pages/home" + end def new @user = User.new @@ -40,11 +43,6 @@ def update end end - def friends - @user = User.find(params[:id]) - @profile = @user.profile - end - private def user_params diff --git a/app/helpers/friends_helper.rb b/app/helpers/friends_helper.rb new file mode 100644 index 000000000..0b69e9bce --- /dev/null +++ b/app/helpers/friends_helper.rb @@ -0,0 +1,2 @@ +module FriendsHelper +end diff --git a/app/models/profile.rb b/app/models/profile.rb index a67bdae00..ed1fe5080 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -5,4 +5,16 @@ class Profile < ApplicationRecord def full_name "#{first_name} #{last_name}" end + + def display_errors(attribute) + message = "" + if self.errors[attribute].any? + message += "#{attribute.capitalize}" + self.errors[attribute].each do |e| + message += " #{e}" + end + end + message + end + end diff --git a/app/models/user.rb b/app/models/user.rb index 84605c8f6..b8594d0a1 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -6,7 +6,7 @@ class User < ApplicationRecord :length => {:in => 8..24}, :allow_nil => true - validates :email, :uniqueness => true + validates :email, uniqueness: {case_sensitive: false} validates_format_of :email, :with => /@/ has_one :profile, inverse_of: :user @@ -41,4 +41,15 @@ def name profile.first_name end + def display_errors(attribute) + message = "" + if self.errors[attribute].any? + message += "#{attribute.capitalize}" + self.errors[attribute].each do |e| + message += " #{e}" + end + end + message + end + end diff --git a/app/views/friends/index.html.erb b/app/views/friends/index.html.erb new file mode 100644 index 000000000..55950ccc7 --- /dev/null +++ b/app/views/friends/index.html.erb @@ -0,0 +1,63 @@ +
+ <%= render :partial => "static_pages/main_nav", :locals => {profile: @profile} %> + + <%= render :partial => "static_pages/main_photo", :locals=>{:profile=> @profile} %> + +
+
+ + +<%= render :partial => "static_pages/middle_nav", :locals => {:page=>"friends", :user => @user} %> + +
+
+
+
+ Friends +
+
+ + + +<% @user.friended_users.each_with_index do |friend, idx| %> + + <% if idx%2 == 0 %> + +
+
+
+ <%= image_tag "wizard_hat.png", alt: "friend's picture", class: "friend-image" %> +
+

<%= link_to friend.profile.full_name, friend %>

+

<%= friend.friended_users.count %> Friends

+
+ <% if authorized_user? %> + <%= link_to "Unfriend me", friendings_path(:id => friend.id), :method => "Delete", :class => "btn btn-default unfriend" %> + <% end %> +
+
+ <% if friend == @user.friended_users.last %> +
+ <% end %> + + <% else %> +
+
+
+ <%= image_tag "wizard_hat.png", alt: "friend's picture", class: "friend-image" %> +
+

<%= link_to friend.profile.full_name, friend %>

+

<%= friend.friended_users.count %> Friends

+
+ <% if authorized_user? %> + <%= link_to "Unfriend me", friendings_path(:id => friend.id), :method => "Delete", :class => "btn btn-default unfriend" %> + <% end %> +
+
+
+ <% end %> +<% end %> + +
+
+
\ No newline at end of file diff --git a/app/views/posts/_timeline_top.html.erb b/app/views/posts/_timeline_top.html.erb index b1aeb2de7..a30a8e102 100644 --- a/app/views/posts/_timeline_top.html.erb +++ b/app/views/posts/_timeline_top.html.erb @@ -1,152 +1,153 @@
<%= render :partial => "static_pages/main_nav", :locals => {profile: profile} %> - <%= render :partial => "static_pages/main_photo", :locals=>{:profile=> profile} %> +<%= render :partial => "static_pages/main_photo", :locals=>{:profile=> profile} %> +
+
+ + <%= render :partial => "static_pages/middle_nav", :locals => {:page=>"timeline", :user => user} %>
-
- - - <%= render :partial => "static_pages/middle_nav", :locals => {:page=>"timeline", :user => user} %> -
- -
- -
-
-
-

About

- - - - - - - - <% if profile.college %> - - <% else %> - - <% end %> - - - - <% if profile.hometown %> - - <% else %> - - <% end %> - - - - <% if profile.currently_lives %> - - <% else %> - - <% end %> - -
Born on: - <%= profile.birthday.strftime("%B %-d %Y") %> -
Went to school at:<%= profile.college %>Nothing here yet!
Hometown:<%= profile.hometown %>Nothing here yet!
Currently Lives:<%= profile.currently_lives %>Nothing here yet!
-
-
-
- -
+ +
+ +
-
-
-

Photos (123)

-
+
+

About

+ + + + + + + + <% if profile.college %> + + <% else %> + + <% end %> + + + + <% if profile.hometown %> + + <% else %> + + <% end %> + + + + <% if profile.currently_lives %> + + <% else %> + + <% end %> + +
Born on: + <%= profile.birthday.strftime("%B %-d %Y") %> +
Went to school at:<%= profile.college %>Nothing here yet!
Hometown:<%= profile.hometown %>Nothing here yet!
Currently Lives:<%= profile.currently_lives %>Nothing here yet!
+
+
+
+ +
+
- -
- +
+ +
+
+
+
+

Friends (<%= user.friended_users.count %>)

- - - <% user.friended_users.each_with_index do |friend, idx| %> +
+ + + <% user.friended_users.each_with_index do |friend, idx| %> + <% if idx == 0 || idx == 3 %> - <% if idx == 0 || idx == 3 %> -
-
- <%= image_tag "wizard_hat.png", alt:"photo", class: "img-responsive" %> - <%= link_to friend.profile.full_name, friend, class: "btn btn-link wrap-text" %> -
- - <% elsif idx == 2 || idx == 5 %> -
- <%= image_tag "wizard_hat.png", alt:"photo", class: "img-responsive" %> - <%= link_to friend.profile.full_name, friend, class: "btn btn-link wrap-text" %> -
-
- <% elsif idx > 6 %> - <% else %> +
<%= image_tag "wizard_hat.png", alt:"photo", class: "img-responsive" %> <%= link_to friend.profile.full_name, friend, class: "btn btn-link wrap-text" %>
- <% end %> - <% if friend == user.friended_users.last && idx != 2 && idx != 5 %> -
- <% end %> + + <% elsif idx == 2 || idx == 5 %> + +
+ <%= image_tag "wizard_hat.png", alt:"photo", class: "img-responsive" %> + <%= link_to friend.profile.full_name, friend, class: "btn btn-link wrap-text" %> +
+
+ <% elsif idx >= 6 %> + <% else %> +
+ <%= image_tag "wizard_hat.png", alt:"photo", class: "img-responsive" %> + <%= link_to friend.profile.full_name, friend, class: "btn btn-link wrap-text" %> +
+ <% end %> + <% if idx<6 && friend == user.friended_users.last && idx != 2 && idx != 5 %> + +
<% end %> - - <% if user.friended_users.count > 6 %> -
- -
<% end %> -
- -
- -
\ No newline at end of file + + <% if user.friended_users.count > 6 %> +
+ +
+ <% end %> +
+ +
+ +
\ No newline at end of file diff --git a/app/views/static_pages/_middle_nav.html.erb b/app/views/static_pages/_middle_nav.html.erb index e48ea1dce..c5d896329 100644 --- a/app/views/static_pages/_middle_nav.html.erb +++ b/app/views/static_pages/_middle_nav.html.erb @@ -10,7 +10,7 @@
diff --git a/app/views/static_pages/_sign_up_form.html.erb b/app/views/static_pages/_sign_up_form.html.erb index 4332c8aba..9d11349b2 100644 --- a/app/views/static_pages/_sign_up_form.html.erb +++ b/app/views/static_pages/_sign_up_form.html.erb @@ -20,14 +20,14 @@
<%= user_fields.text_field :email, placeholder: "Your Email", class: "sign-up-form" %> - <%= user.errors["email"] if user.errors["email"].any? %> + <%= user.display_errors("email")%>
<%= user_fields.password_field :password, placeholder: "Your New Password", class: "sign-up-form" %> - <%= user.errors["password"] if user.errors["password"].any? %> + <%= user.display_errors("password") %>
diff --git a/app/views/users/friends.html.erb b/app/views/users/friends.html.erb index 2e85da717..0ca23a01c 100644 --- a/app/views/users/friends.html.erb +++ b/app/views/users/friends.html.erb @@ -1,3 +1,4 @@ +
<%= render :partial => "static_pages/main_nav", :locals => {profile: @profile} %> diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 2c47795df..8f14227b3 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -14,11 +14,6 @@
About - <% if authorized_user? %> - - <% end %>
diff --git a/config/routes.rb b/config/routes.rb index 58022b4aa..0aac5f17f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -7,6 +7,7 @@ get "about_edit" => "static_pages#about_edit" resources :users do resources :posts + resources :friends, :only => [:index] end resources :posts, :only=>[] do resources :likes, :only=>[:create,:destroy] @@ -21,6 +22,6 @@ resource :friendings, :only => [:create, :destroy] - get "friends" => "users#friends" + #get "friends" => "users#friends" # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html end diff --git a/spec/controllers/comments_controller_spec.rb b/spec/controllers/comments_controller_spec.rb new file mode 100644 index 000000000..8f51b6dc2 --- /dev/null +++ b/spec/controllers/comments_controller_spec.rb @@ -0,0 +1,38 @@ +require 'rails_helper' + +describe CommentsController do +let(:new_post){ create(:post) } +let(:user){ create(:user) } + before do + request.cookies["auth_token"] = user.auth_token + new_post + end + + describe "POST #create" do + it "creates a new comment" do + expect{ post :create, params:{ post_id: new_post.id, comment: attributes_for(:comment)} }.to change(Comment, :count).by(1) + end + + it "redirects to timeline" do + post :create, params:{ post_id: new_post.id, comment: attributes_for(:comment) } + expect(response).to redirect_to user_posts_path(new_post.user) + end + end + + describe "DELETE #destroy" do + let(:new_comment){ create(:comment, post: new_post) } + before do + new_comment + end + + it "deletes a comment" do + expect{ delete :destroy, params:{ id: new_comment.id, post_id: new_post.id } }.to change(Comment, :count).by(-1) + end + + it "redirects to timeline" do + delete :destroy, params:{ id: new_comment.id, post_id: new_post.id } + expect(response).to redirect_to user_posts_path(new_post.user) + end + end + +end \ No newline at end of file diff --git a/spec/controllers/friends_controller_spec.rb b/spec/controllers/friends_controller_spec.rb new file mode 100644 index 000000000..6745a5a58 --- /dev/null +++ b/spec/controllers/friends_controller_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe FriendsController, type: :controller do + +end diff --git a/spec/controllers/likes_controller_spec.rb b/spec/controllers/likes_controller_spec.rb new file mode 100644 index 000000000..7f0217761 --- /dev/null +++ b/spec/controllers/likes_controller_spec.rb @@ -0,0 +1,56 @@ +require 'rails_helper' + +describe LikesController do + let(:user){ create(:user) } + let(:new_post){ create(:post, user: user) } + let(:comment){ create(:comment) } + + before do + request.cookies["auth_token"] = user.auth_token + new_post + comment + end + + describe "POST #create" do + it "sets post variable when on a post" do + post :create, params:{post_id: new_post.id} + expect(assigns(:post)).to eq(new_post) + end + + it "actually creates a like" do + expect { post :create, params:{post_id: new_post.id} }.to change(Like, :count).by(1) + end + + it "sets comment variable when on a comment" do + post :create, params:{comment_id: comment.id} + expect(assigns(:comment)).to eq(comment) + end + end + + describe "DELETE #destroy" do + + let(:like){ create(:like, :on_post) } + let(:liked_post){ like.likeable } + let(:comment_like){ create(:like, :on_comment) } + let(:liked_comment){ comment_like.likeable } + + before do + liked_post + end + + it "sets post variable for a post" do + delete :destroy, params:{post_id: liked_post.id, id: like.id } + expect(assigns(:post)).to eq(liked_post) + end + + it "actually deletes the like" do + expect{ delete :destroy, params:{post_id: liked_post.id, id: like.id } }.to change(Like, :count).by(-1) + end + + it "sets the comment variable for a comment" do + delete :destroy, params:{comment_id: liked_comment.id, id: comment_like.id } + expect(assigns(:comment)).to eq(liked_comment) + end + + end +end \ No newline at end of file diff --git a/spec/controllers/posts_controller_spec.rb b/spec/controllers/posts_controller_spec.rb new file mode 100644 index 000000000..bc1266bfa --- /dev/null +++ b/spec/controllers/posts_controller_spec.rb @@ -0,0 +1,56 @@ +require 'rails_helper' + +describe PostsController do + let(:user){ create(:user) } + + before do + request.cookies["auth_token"] = user.auth_token + end + + describe 'GET #index' do + it "goes to index if on someone else's page" do + another_user = create(:user) + get :index, :user_id => another_user.id + expect(response).to render_template :index + end + + it "goes to new if on your own page" do + get :index, :user_id => user.id + expect(response).to redirect_to new_user_post_path(user) + end + end + + describe 'POST #create' do + it "creates a new post" do + expect{ post :create, :user_id => user.id, :post => attributes_for(:post) }.to change(Post, :count).by(1) + end + + it "redirects to the user's timeline" do + post :create, :user_id => user.id, :post => attributes_for(:post) + expect(response).to redirect_to new_user_post_path(user) + end + + it "renders new for an empty body" do + post :create, :user_id => user.id, :post => attributes_for(:post, body:"") + expect(response).to render_template :new + end + end + + describe "DELETE #destroy" do + + let(:new_post){ create(:post, user:user) } + before do + new_post + end + + it "deletes the post" do + expect{ delete :destroy, :user_id => user, :id => new_post.id }.to change(Post, :count).by(-1) + end + + it "redirects to timeline" do + delete :destroy, :user_id => user, :id => new_post.id + expect(response).to redirect_to new_user_post_path(user) + end + end + +end \ No newline at end of file diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb new file mode 100644 index 000000000..c9d5b920e --- /dev/null +++ b/spec/controllers/users_controller_spec.rb @@ -0,0 +1,56 @@ +require 'rails_helper' + +describe UsersController do + + describe "POST #create" do + it "redirects to show page" do + post :create, :user => attributes_for(:user) + expect(response).to redirect_to user_path(assigns(:user)) + end + + it "actually creates the user" do + expect{ post :create, user: attributes_for(:user) }.to change(User, :count).by(1) + end + + it "renders home page when provided invalid information" do + post :create, :user => attributes_for(:user, email: "") + expect(response).to render_template "static_pages/home" + end + end + + describe "GET #edit" do + let(:user){ create(:user) } + let(:profile){ create(:profile, user: user) } + before do + request.cookies["auth_token"] = user.auth_token + end + + it "collects the user's profile" do + get :edit, :id => user.id + expect(assigns(:profile)).to eq(user.profile) + end + + it "does not work if user is not authorized" do + another_user = create(:user) + get :edit, :id => another_user.id + expect(flash[:error]).to_not be nil + expect(response).to redirect_to root_path + end + end + + describe "PATCH #update" do + let(:user){ create(:user) } + let(:profile){ create(:profile, user: user) } + before do + request.cookies["auth_token"] = user.auth_token + profile + end + + it "updates the user's profile" do + put :update, :id => user.id, :user => attributes_for(:user).merge(profile_attributes: attributes_for(:profile, college: "Foo University")) + user.reload + expect(user.profile.college).to eq("Foo University") + end + + end +end \ No newline at end of file diff --git a/spec/factories/comment_factory.rb b/spec/factories/comment_factory.rb index a113f77d7..7d5054bc1 100644 --- a/spec/factories/comment_factory.rb +++ b/spec/factories/comment_factory.rb @@ -1,6 +1,6 @@ FactoryGirl.define do factory :comment do - body "This is a post" + body "This is a comment" user post end diff --git a/spec/features/comments_spec.rb b/spec/features/comments_spec.rb new file mode 100644 index 000000000..8694d520f --- /dev/null +++ b/spec/features/comments_spec.rb @@ -0,0 +1,23 @@ +require 'rails_helper' + +feature 'comments' do + + before do + visit root_path + user = create(:user) + profile = create(:profile, user: user) + login(user) + user_2 = create(:user) + profile_2 = create(:profile, user: user_2) + post = create(:post, user: user_2) + visit (user_posts_path(user_2)) + end + + scenario 'user comments on a post' do + fill_in('comment_body', with: "This is a comment") + expect{ click_button('Comment') }.to change(Comment, :count).from(0).to(1) + expect(page).to have_content("This is a comment") + expect(page).to have_content("Delete") + expect{ click_link('Delete') }.to change(Comment, :count).from(1).to(0) + end +end \ No newline at end of file diff --git a/spec/features/friends_spec.rb b/spec/features/friends_spec.rb new file mode 100644 index 000000000..9107879f5 --- /dev/null +++ b/spec/features/friends_spec.rb @@ -0,0 +1,56 @@ +require 'rails_helper' + +feature 'friending' do + + let!(:user){ create(:user) } + let!(:profile){ create(:profile, user:user) } + let!(:user_2){ create(:user) } + let!(:profile_2){ create(:profile, user: user_2) } + + before do + visit root_path + login(user) + end + + scenario 'user on another user\'s about page' do + visit(user_path(user_2)) + expect(page).to have_content("Friend #{user_2.profile.first_name}") + expect{ click_link("Friend #{user_2.profile.first_name}") }.to change(Friending, :count).from(0).to(1) + expect(page).to have_content("Unfriend #{user_2.profile.first_name}") + expect{ click_link("Unfriend #{user_2.profile.first_name}") }.to change(Friending, :count).from(1).to(0) + end + + scenario 'user on their own timeline' do + visit(user_path(user_2)) + click_link("Friend #{user_2.profile.first_name}") + visit(user_posts_path(user)) + expect(page).to have_content("Friends(1)") + expect(page).to have_content("#{user_2.profile.full_name}") + end + + scenario 'user on their own friends page' do + visit(user_path(user_2)) + click_link("Friend #{user_2.profile.first_name}") + visit(user_posts_path(user)) + click_link("Friends(1)") + expect(page).to have_content("#{user_2.profile.full_name}") + end + + scenario 'user has many friends' do + users_to_friend = [] + 7.times do + user = create(:user) + create(:profile, user: user) + users_to_friend << user + end + users_to_friend.each do |f| + visit(user_path(f)) + click_link("Friend #{f.profile.first_name}") + end + visit(user_posts_path(user)) + # save_and_open_page + # expect(page).to have_content("Friends(6)") + click_link("Friends(7)") + save_and_open_page + end +end \ No newline at end of file diff --git a/spec/features/likes_spec.rb b/spec/features/likes_spec.rb new file mode 100644 index 000000000..803e2d2d0 --- /dev/null +++ b/spec/features/likes_spec.rb @@ -0,0 +1,23 @@ +require 'rails_helper' + +feature 'liking posts' do + + before do + visit root_path + user = create(:user) + profile = create(:profile, user: user) + login(user) + user_2 = create(:user) + profile_2 = create(:profile, user: user_2) + post = create(:post, user: user_2) + visit (user_posts_path(user_2)) + end + + scenario 'user likes a post' do + expect{ click_link('Like') }.to change(Like, :count).from(0).to(1) + expect(page).to have_content("You like this") + expect(page).to have_content("Unlike") + expect{ click_link('Unlike') }.to change(Like, :count).from(1).to(0) + end + +end \ No newline at end of file diff --git a/spec/features/posts_spec.rb b/spec/features/posts_spec.rb new file mode 100644 index 000000000..b110058c9 --- /dev/null +++ b/spec/features/posts_spec.rb @@ -0,0 +1,41 @@ +require 'rails_helper' + +feature 'creating and deleting posts' do + + before do + visit root_path + user = create(:user) + profile = create(:profile, user: user) + login(user) + click_link("Timeline") + end + + scenario 'logged in user on their own timeline' do + expect(page).to have_selector('textarea') + fill_in 'post_body', with: "This is my post" + expect{ click_button('Post') }.to change(Post,:count).from(0).to(1) + expect(page).to have_content("This is my post") + expect(page).to have_content("Delete") + expect{ click_link('Delete') }.to change(Post, :count).from(1).to(0) + end + + scenario 'user on another user\'s timeline' do + user_2 = create(:user) + profile_2 = create(:profile, user: user_2) + visit (user_posts_path(user_2)) + expect(page).not_to have_selector('textarea') + expect(page).to have_content('has no posts yet!') + end + + scenario 'user seeing another user\'s posts' do + user_2 = create(:user) + profile_2 = create(:profile, user: user_2) + post = create(:post, user: user_2) + visit (user_posts_path(user_2)) + expect(page).to have_content("This is a post") + expect(page).to have_content("Like") + expect(page).to have_content("Comment") + expect(page).not_to have_content("Delete") + end + +end \ No newline at end of file diff --git a/spec/features/users_spec.rb b/spec/features/users_spec.rb new file mode 100644 index 000000000..8b7950a72 --- /dev/null +++ b/spec/features/users_spec.rb @@ -0,0 +1,82 @@ +require 'rails_helper' + +feature 'User signup' do + before do + visit root_path + end + + scenario "user sign-up" do + sign_up("Foo", "Bar") + expect{ click_on("Sign Up!") }.to change(User,:count).from(0).to(1) + expect(find('#big-profile-name')).to have_content("Foo Bar") + expect(find('#profile-name')).to have_content("Foo") + end + + scenario "user signs up with missing information" do + sign_up + expect{ click_on("Sign Up!") }.not_to change(User,:count) + expect(page).to have_content("can't be blank") + end + + scenario "user signs up with same email" do + create(:user, email: "foo@bar.com") + sign_up("Foo", "Bar") + click_on("Sign Up!") + expect(page).to have_content("has already been taken") + end +end + +feature 'User sign-in' do + + before do + visit root_path + end + + let!(:user){ create(:user) } + let!(:profile){ create(:profile, user: user) } + + scenario "user with an account logs in" do + login(user) + expect(current_path).to eq(user_path(user)) + end + + scenario "user puts in wrong password" do + wrong_login(user) + expect(page).to have_content("We couldn't sign you in") + expect(current_path).to eq(root_path) + end + + scenario "user logs out" do + login(user) + click_link("Logout") + expect(current_path).to eq(root_path) + end + +end + +feature 'about page' do + + before do + visit root_path + user = create(:user) + profile = create(:profile, user: user) + login(user) + end + + scenario "logged in user on their own about page" do + expect(page).to have_content("Edit Profile") + click_link("Edit Profile") + expect(page).to have_selector('textarea') + expect(page).to have_selector('#save_changes') + edit_profile("These are inspiring words") + expect(page).to have_content("These are inspiring words") + end + + scenario "user on another user's about page" do + user_2 = create(:user) + profile_2 = create(:profile, user: user_2) + visit user_path(user_2) + expect(page).not_to have_content("Edit Profile") + end + +end \ No newline at end of file diff --git a/spec/helpers/friends_helper_spec.rb b/spec/helpers/friends_helper_spec.rb new file mode 100644 index 000000000..4d5686bb3 --- /dev/null +++ b/spec/helpers/friends_helper_spec.rb @@ -0,0 +1,15 @@ +require 'rails_helper' + +# Specs in this file have access to a helper object that includes +# the FriendsHelper. For example: +# +# describe FriendsHelper do +# describe "string concat" do +# it "concats two strings with spaces" do +# expect(helper.concat_strings("this","that")).to eq("this that") +# end +# end +# end +RSpec.describe FriendsHelper, type: :helper do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 5e2888f53..65383c756 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -1,4 +1,3 @@ -require 'factory_girl_rails' # This file is copied to spec/ when you run 'rails generate rspec:install' ENV['RAILS_ENV'] ||= 'test' require File.expand_path('../../config/environment', __FILE__) @@ -6,6 +5,8 @@ abort("The Rails environment is running in production mode!") if Rails.env.production? require 'spec_helper' require 'rspec/rails' +require 'factory_girl_rails' +require 'capybara/rails' # Add additional requires below this line. Rails is not loaded until this point! # Requires supporting ruby files with custom matchers and macros, etc, in @@ -21,7 +22,7 @@ # directory. Alternatively, in the individual `*_spec.rb` files, manually # require only the support files necessary. # -# Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f } +Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f } # Checks for pending migration and applies them before tests are run. # If you are not using ActiveRecord, you can remove this line. @@ -31,6 +32,7 @@ # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures config.fixture_path = "#{::Rails.root}/spec/fixtures" config.include FactoryGirl::Syntax::Methods + config.include UserMacros # If you're not using ActiveRecord, or you'd prefer not to run each of your # examples within a transaction, remove the following line or assign false # instead of true. diff --git a/spec/support/user_macros.rb b/spec/support/user_macros.rb new file mode 100644 index 000000000..c36289c25 --- /dev/null +++ b/spec/support/user_macros.rb @@ -0,0 +1,27 @@ +module UserMacros + def sign_up(first_name="", last_name="") + fill_in "First Name", with: first_name + fill_in "Last Name", with: last_name + fill_in "Your Email", with: "#{first_name}@#{last_name}.com" + fill_in "Your New Password", with: "12345678" + fill_in "Confirm Your Password", with: "12345678" + choose('user_profile_attributes_gender_female') + end + + def login(user) + fill_in "Email", with: user.email + fill_in "Password", with: user.password + click_button("Log in") + end + + def wrong_login(user) + fill_in "Email", with: user.email + fill_in "Password", with: "#{user.password}foo!" + click_button("Log in") + end + + def edit_profile(text) + fill_in "user_profile_attributes_words_to_live_by", with: text + click_button("Save Changes") + end +end \ No newline at end of file diff --git a/spec/views/friends/index_spec.rb b/spec/views/friends/index_spec.rb new file mode 100644 index 000000000..9952bfa20 --- /dev/null +++ b/spec/views/friends/index_spec.rb @@ -0,0 +1,36 @@ +require 'rails_helper' + +describe 'friends/index.html.erb' do + let(:user){ create(:user) } + let(:profile){ create(:profile, user:user) } + before do + def view.authorized_user? + true + end + + @user = user + def view.current_user + @user + end + end + + it "shows one box for each friend" do + assign(:user, user) + assign(:profile, profile) + 7.times do + to_friend = create(:user) + create(:profile, user: to_friend) + user.friended_users << to_friend + end + user.reload + visit(user_friends_path(user)) + #render + page.assert_selector('.friend-box', :count => 7) + #expect(page.all(:css, '.friend-box').size).to eq(7) + end + + it "shows the number of friends" do + + end + +end \ No newline at end of file diff --git a/spec/views/posts/_timeline_top_spec.rb b/spec/views/posts/_timeline_top_spec.rb new file mode 100644 index 000000000..99d65de2e --- /dev/null +++ b/spec/views/posts/_timeline_top_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +describe "posts/_timeline_top.html.erb" do + +end \ No newline at end of file From 192fb7009b5ccfde7b384a51683ed23fae55d419 Mon Sep 17 00:00:00 2001 From: David Jiang Date: Thu, 18 Aug 2016 15:34:57 -0700 Subject: [PATCH 18/39] set up tests for photos --- .gitignore | 3 ++ Gemfile | 4 +- Gemfile.lock | 23 ++++++++++ config/environments/development.rb | 11 ++++- config/environments/production.rb | 10 ++++- config/secrets.yml | 8 +++- spec/controllers/photos_controller_spec.rb | 19 ++++++++ spec/features/photos_spec.rb | 52 ++++++++++++++++++++++ spec/models/photo_spec.rb | 16 +++++++ spec/rails_helper.rb | 1 + spec/support/photo_macros.rb | 5 +++ spec/views/friends/index_spec.rb | 9 ++-- 12 files changed, 152 insertions(+), 9 deletions(-) create mode 100644 spec/controllers/photos_controller_spec.rb create mode 100644 spec/features/photos_spec.rb create mode 100644 spec/models/photo_spec.rb create mode 100644 spec/support/photo_macros.rb diff --git a/.gitignore b/.gitignore index bab620de0..f0774c34e 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,6 @@ # Ignore Byebug command history file. .byebug_history + +# Ignore application configuration +/config/application.yml diff --git a/Gemfile b/Gemfile index a7874ce94..e2de3c1c2 100644 --- a/Gemfile +++ b/Gemfile @@ -25,7 +25,9 @@ gem 'jbuilder', '~> 2.5' # gem 'redis', '~> 3.0' # Use ActiveModel has_secure_password gem 'bcrypt', '~> 3.1.7' - + gem 'paperclip' + gem 'aws-sdk' + gem 'figaro' # Use Capistrano for deployment # gem 'capistrano-rails', group: :development group :production do diff --git a/Gemfile.lock b/Gemfile.lock index f1e8680ab..49cac076a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -40,6 +40,12 @@ GEM tzinfo (~> 1.1) addressable (2.4.0) arel (7.1.1) + aws-sdk (2.5.4) + aws-sdk-resources (= 2.5.4) + aws-sdk-core (2.5.4) + jmespath (~> 1.0) + aws-sdk-resources (2.5.4) + aws-sdk-core (= 2.5.4) bcrypt (3.1.11) better_errors (2.1.1) coderay (>= 1.0.0) @@ -56,6 +62,10 @@ GEM rack (>= 1.0.0) rack-test (>= 0.5.4) xpath (~> 2.0) + climate_control (0.0.3) + activesupport (>= 3.0) + cocaine (0.5.8) + climate_control (>= 0.0.3, < 1.0) coderay (1.1.1) coffee-rails (4.2.1) coffee-script (>= 2.2.0) @@ -75,6 +85,8 @@ GEM factory_girl (~> 4.5.0) railties (>= 3.0.0) ffi (1.9.14) + figaro (1.1.1) + thor (~> 0.14) formatador (0.2.5) globalid (0.3.7) activesupport (>= 4.1.0) @@ -97,6 +109,7 @@ GEM jbuilder (2.6.0) activesupport (>= 3.0.0, < 5.1) multi_json (~> 1.2) + jmespath (1.3.1) jquery-rails (4.1.1) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) @@ -115,6 +128,7 @@ GEM mime-types (3.1) mime-types-data (~> 3.2015) mime-types-data (3.2016.0521) + mimemagic (0.3.2) mini_portile2 (2.1.0) minitest (5.9.0) multi_json (1.12.1) @@ -126,6 +140,12 @@ GEM notiffany (0.1.0) nenv (~> 0.1) shellany (~> 0.0) + paperclip (5.0.0) + activemodel (>= 4.2.0) + activesupport (>= 4.2.0) + cocaine (~> 0.5.5) + mime-types + mimemagic (~> 0.3.0) pg (0.18.4) pkg-config (1.1.7) pry (0.10.4) @@ -241,6 +261,7 @@ PLATFORMS ruby DEPENDENCIES + aws-sdk bcrypt (~> 3.1.7) better_errors binding_of_caller @@ -248,12 +269,14 @@ DEPENDENCIES capybara coffee-rails (~> 4.2) factory_girl_rails (~> 4.0) + figaro guard-rspec hirb jbuilder (~> 2.5) jquery-rails launchy listen (~> 3.0.5) + paperclip pg puma (~> 3.0) rails (~> 5.0.0) diff --git a/config/environments/development.rb b/config/environments/development.rb index 6f7197045..9e7753227 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -1,6 +1,15 @@ Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. - + config.paperclip_defaults = { + :storage => :s3, + :s3_credentials => { + :s3_host_name => "s3-us-west-2.amazonaws.com" + :bucket => Rails.application.secrets.s3_bucket_name, + :access_key_id => Rails.application.secrets.aws_access_key_id, + :secret_access_key => Rails.application.secrets.aws_secret_access_key, + :s3_region=> Rails.application.secrets.s3_region + } + } # 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. diff --git a/config/environments/production.rb b/config/environments/production.rb index e43500ee1..a09e7a31b 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -1,6 +1,14 @@ Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. - + config.paperclip_defaults = { + :storage => :s3, + :s3_credentials => { + :s3_host_name => "s3-us-west-2.amazonaws.com" + :bucket => Rails.application.secrets.s3_bucket_name, + :access_key_id => Rails.application.secrets.aws_access_key_id, + :secret_access_key => Rails.application.secrets.aws_secret_access_key + } + } # Code is not reloaded between requests. config.cache_classes = true diff --git a/config/secrets.yml b/config/secrets.yml index 1af36da5d..311d846d0 100644 --- a/config/secrets.yml +++ b/config/secrets.yml @@ -12,7 +12,10 @@ development: secret_key_base: f440b79111f00fbaabf242f3af5457e16d82366e6a5b53398b9bd45897158662406598666e948babbe23a063c08dbac135d2bdbbf1e11d7170feac5b927a4929 - + s3_bucket_name: <%= ENV["S3_BUCKET_NAME"] %> + aws_access_key_id: <%= ENV["AWS_ACCESS_KEY_ID"] %> + aws_secret_access_key: <%= ENV["AWS_SECRET_ACCESS_KEY"] %> + s3_region: <%= ENV["S3_REGION"] %> test: secret_key_base: 9365fec3b5678a9ffdc65fbcac9b1dcc8aad2856876f2067ce67bb3eb189e1d8353adafabe895b6f3febe45369acc2165e904ca5601fcb4b95d72d0cb49ab12f @@ -20,3 +23,6 @@ test: # instead read values from the environment. production: secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> + s3_bucket_name: <%= ENV["S3_BUCKET_NAME"] %> + aws_access_key_id: <%= ENV["AWS_ACCESS_KEY_ID"] %> + aws_secret_access_key: <%= ENV["AWS_SECRET_ACCESS_KEY"] %> \ No newline at end of file diff --git a/spec/controllers/photos_controller_spec.rb b/spec/controllers/photos_controller_spec.rb new file mode 100644 index 000000000..9ff88ebac --- /dev/null +++ b/spec/controllers/photos_controller_spec.rb @@ -0,0 +1,19 @@ +require 'rails_helper' + +describe PhotosController do +let(:user){ create(:user) } +#create a photo for that user + + before do + request.cookies["auth_token"] = user.auth_token + end + + describe "POST #create" do + xit "creates a new photo" do + end + + xit "redirects to photos page" do + end + end + +end diff --git a/spec/features/photos_spec.rb b/spec/features/photos_spec.rb new file mode 100644 index 000000000..360f0fdd0 --- /dev/null +++ b/spec/features/photos_spec.rb @@ -0,0 +1,52 @@ +require 'rails_helper' + +feature 'photos' do + + before do + visit root_path + user = create(:user) + profile = create(:profile, user: user) + login(user) + visit(user_photos_path(user)) + end + + scenario 'adding photos' do + upload_photo + expect(page).to have_content("Photos(1)") + expect(page.has_selector?('.thumbnail')).to be_true + end + + scenario 'clicking on a photo' do + upload_photo + click_on("Photo") + expect(current_path).to eq(photo) + end + + feature 'selecting a photo as profile or cover photo' do + upload_photo + click_on("Photo") + expect(page).to have_content("profile") + expect(page).to have_content("cover") + end + + feature 'commenting on a photo' do + upload_photo + click_on("Photo") + #fill in comment and press enter + #expect page to have one comment + #delete the comment + #expect page to have no comments + end + + feature 'liking a photo' do + upload_photo + click_on("Photo") + #click "Like" + #expect page to have one like + #click "Unlike" + #expect page to have no likes + end + +end + + diff --git a/spec/models/photo_spec.rb b/spec/models/photo_spec.rb new file mode 100644 index 000000000..8ea977fba --- /dev/null +++ b/spec/models/photo_spec.rb @@ -0,0 +1,16 @@ +require 'rails_helper' + +describe Photo do + +#create a photo with a factory + +xit "is valid with default attributes" do +end + +xit{ should belong_to(:user) } + +xit "doesn't allow invalid formats" do +end + + +end \ No newline at end of file diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 65383c756..d093386eb 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -33,6 +33,7 @@ config.fixture_path = "#{::Rails.root}/spec/fixtures" config.include FactoryGirl::Syntax::Methods config.include UserMacros + config.include PhotoMacros # If you're not using ActiveRecord, or you'd prefer not to run each of your # examples within a transaction, remove the following line or assign false # instead of true. diff --git a/spec/support/photo_macros.rb b/spec/support/photo_macros.rb new file mode 100644 index 000000000..7fb198898 --- /dev/null +++ b/spec/support/photo_macros.rb @@ -0,0 +1,5 @@ +module PhotoMacros + def upload_photo + page.attach_file('Add Photo', '/app/assets/images/icon_photo_small.png') + end +end \ No newline at end of file diff --git a/spec/views/friends/index_spec.rb b/spec/views/friends/index_spec.rb index 9952bfa20..f7795e597 100644 --- a/spec/views/friends/index_spec.rb +++ b/spec/views/friends/index_spec.rb @@ -22,14 +22,13 @@ def view.current_user create(:profile, user: to_friend) user.friended_users << to_friend end + user.save user.reload - visit(user_friends_path(user)) - #render - page.assert_selector('.friend-box', :count => 7) - #expect(page.all(:css, '.friend-box').size).to eq(7) + render + expect(rendered).to have_selector('.friend-box', count: 7) end - it "shows the number of friends" do + xit "shows the number of friends" do end From 4165114a73002bd940580b49fb08b1f5d60267bf Mon Sep 17 00:00:00 2001 From: David Jiang Date: Fri, 19 Aug 2016 17:03:11 -0700 Subject: [PATCH 19/39] photos and welcome email --- Gemfile | 2 + Gemfile.lock | 9 ++ app/assets/javascripts/photos.coffee | 3 + app/assets/stylesheets/photos.scss | 3 + app/controllers/application_controller.rb | 6 +- app/controllers/comments_controller.rb | 43 ++++++-- app/controllers/likes_controller.rb | 39 ++++++- app/controllers/photos_controller.rb | 52 +++++++++ app/controllers/users_controller.rb | 1 + app/helpers/application_helper.rb | 16 +++ app/helpers/photos_helper.rb | 2 + app/mailers/user_mailer.rb | 8 ++ app/models/comment.rb | 6 +- app/models/photo.rb | 13 +++ app/models/post.rb | 2 +- app/models/profile.rb | 1 + app/models/user.rb | 16 ++- app/views/friends/index.html.erb | 2 +- app/views/photos/_photo_form.html.erb | 4 + app/views/photos/index.html.erb | 39 +++++++ app/views/photos/show.html.erb | 104 ++++++++++++++++++ app/views/posts/_timeline_bottom.html.erb | 12 +- app/views/posts/_timeline_top.html.erb | 73 ++++++------ app/views/static_pages/_main_photo.html.erb | 26 +++-- app/views/static_pages/_middle_nav.html.erb | 4 +- app/views/user_mailer/welcome.html.erb | 20 ++++ app/views/user_mailer/welcome.text.erb | 12 ++ app/views/users/show.html.erb | 2 +- bin/delayed_job | 5 + config/environments/development.rb | 7 +- config/environments/production.rb | 2 +- config/routes.rb | 6 + db/migrate/20160818223733_create_photos.rb | 10 ++ .../20160818225711_add_user_id_to_photos.rb | 6 + .../20160819165819_create_delayed_jobs.rb | 22 ++++ .../20160819180806_polymorphic_comments.rb | 8 ++ db/schema.rb | 37 ++++++- spec/factories/photo_factory.rb | 9 ++ spec/helpers/photos_helper_spec.rb | 15 +++ spec/mailers/previews/user_mailer_preview.rb | 4 + spec/mailers/user_mailer_spec.rb | 5 + 41 files changed, 571 insertions(+), 85 deletions(-) create mode 100644 app/assets/javascripts/photos.coffee create mode 100644 app/assets/stylesheets/photos.scss create mode 100644 app/controllers/photos_controller.rb create mode 100644 app/helpers/photos_helper.rb create mode 100644 app/mailers/user_mailer.rb create mode 100644 app/models/photo.rb create mode 100644 app/views/photos/_photo_form.html.erb create mode 100644 app/views/photos/index.html.erb create mode 100644 app/views/photos/show.html.erb create mode 100644 app/views/user_mailer/welcome.html.erb create mode 100644 app/views/user_mailer/welcome.text.erb create mode 100755 bin/delayed_job create mode 100644 db/migrate/20160818223733_create_photos.rb create mode 100644 db/migrate/20160818225711_add_user_id_to_photos.rb create mode 100644 db/migrate/20160819165819_create_delayed_jobs.rb create mode 100644 db/migrate/20160819180806_polymorphic_comments.rb create mode 100644 spec/factories/photo_factory.rb create mode 100644 spec/helpers/photos_helper_spec.rb create mode 100644 spec/mailers/previews/user_mailer_preview.rb create mode 100644 spec/mailers/user_mailer_spec.rb diff --git a/Gemfile b/Gemfile index e2de3c1c2..79621bc0b 100644 --- a/Gemfile +++ b/Gemfile @@ -62,6 +62,8 @@ group :development do gem 'better_errors' gem 'binding_of_caller' gem 'guard-rspec', require: false + gem 'letter_opener' + gem 'delayed_job_active_record' end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem diff --git a/Gemfile.lock b/Gemfile.lock index 49cac076a..b86102931 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -76,6 +76,11 @@ GEM coffee-script-source (1.10.0) concurrent-ruby (1.0.2) debug_inspector (0.0.2) + delayed_job (4.1.2) + activesupport (>= 3.0, < 5.1) + delayed_job_active_record (4.1.1) + activerecord (>= 3.0, < 5.1) + delayed_job (>= 3.0, < 5) diff-lcs (1.2.5) erubis (2.7.0) execjs (2.7.0) @@ -116,6 +121,8 @@ GEM thor (>= 0.14, < 2.0) launchy (2.4.3) addressable (~> 2.3) + letter_opener (1.4.1) + launchy (~> 2.2) listen (3.0.8) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) @@ -268,6 +275,7 @@ DEPENDENCIES byebug capybara coffee-rails (~> 4.2) + delayed_job_active_record factory_girl_rails (~> 4.0) figaro guard-rspec @@ -275,6 +283,7 @@ DEPENDENCIES jbuilder (~> 2.5) jquery-rails launchy + letter_opener listen (~> 3.0.5) paperclip pg diff --git a/app/assets/javascripts/photos.coffee b/app/assets/javascripts/photos.coffee new file mode 100644 index 000000000..24f83d18b --- /dev/null +++ b/app/assets/javascripts/photos.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/photos.scss b/app/assets/stylesheets/photos.scss new file mode 100644 index 000000000..1a3e082cd --- /dev/null +++ b/app/assets/stylesheets/photos.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the photos controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 3f5e72a99..f6021d072 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -37,8 +37,10 @@ def require_login end end - def authorized_user? - if params[:user_id] + def authorized_user?(user = nil) + if user + user.id == current_user.id + elsif params[:user_id] params[:user_id]==current_user.id.to_s else params[:id]==current_user.id.to_s diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 822aefb44..576102d5d 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -1,13 +1,29 @@ class CommentsController < ApplicationController def create - @post = Post.find(params[:post_id]) - @user = @post.user - @comment = Comment.new(:post_id => params[:post_id].to_i, - :user_id => current_user.id, - :body => params[:comment][:body]) + #if its on a post + if params[:post_id] + @post = Post.find(params[:post_id]) + parent_id = params[:post_id] + @user = @post.user + type = "Post" + #if its on a photo + else + @photo = Photo.find(params[:photo_id]) + @user = @photo.user + parent_id = params[:photo_id] + type = "Photo" + end + @comment = Comment.new(:commentable_id => parent_id.to_i, + :commentable_type => type, + :user_id => current_user.id, + :body => params[:comment][:body]) if @comment.save - redirect_to user_posts_path(@user) + if type == "Photo" + redirect_to user_photo_path(@user, @photo) + elsif type == "Post" + redirect_to user_posts_path(@user) + end else redirect_to user_posts_path(@user) end @@ -15,10 +31,19 @@ def create def destroy @comment = Comment.find(params[:id]) - @post = Post.find(params[:post_id]) - @user = @post.user + if params[:post_id] + @post = Post.find(params[:post_id]) + @user = @post.user + else + @photo = Photo.find(params[:photo_id]) + @user = @photo.user + end @comment.destroy - redirect_to user_posts_path(@user) + if params[:post_id] + redirect_to user_posts_path(@user) + elsif params[:photo_id] + redirect_to user_photo_path(@user, @photo) + end end end diff --git a/app/controllers/likes_controller.rb b/app/controllers/likes_controller.rb index 01cb51a8d..4e325ee66 100644 --- a/app/controllers/likes_controller.rb +++ b/app/controllers/likes_controller.rb @@ -7,13 +7,27 @@ def create @user = @post.user @like = @post.likes.build(:user_id => current_user.id) #if its for a comment - else + elsif params[:comment_id] @comment = Comment.find(params[:comment_id]) - @user = @comment.post.user @like = @comment.likes.build(:user_id => current_user.id) + #if its for a photo + else + @photo = Photo.find(params[:photo_id]) + @user = @photo.user + @like = @photo.likes.build(:user_id => current_user.id) end @like.save - redirect_to user_posts_path(@user) + if params[:post_id] + redirect_to user_posts_path(@user) + elsif params[:comment_id] && @comment.commentable_type == "Post" + @user = @comment.commentable.user + redirect_to user_posts_path(@user) + elsif params[:comment_id] && @comment.commentable_type == "Photo" + @photo = @comment.commentable + redirect_to photo_path(@photo) + else + redirect_to photo_path(@photo) + end end def destroy @@ -22,13 +36,26 @@ def destroy @post = Post.find(params[:post_id]) @user = @post.user #if its for a comment - else + elsif params[:comment_id] @comment = Comment.find(params[:comment_id]) - @user = @comment.post.user + #if its for a photo + else + @photo = Photo.find(params[:photo_id]) + @user = @photo.user end @like = Like.find(params[:id]) @like.destroy - redirect_to user_posts_path(@user) + if params[:post_id] + redirect_to user_posts_path(@user) + elsif params[:comment_id] && @comment.commentable_type == "Post" + @user = @comment.post.user + redirect_to user_posts_path(@user) + elsif params[:comment_id] && @comment.commentable_type == "Photo" + @photo = @comment.commentable + redirect_to photo_path(@photo) + else + redirect_to photo_path(@photo) + end end end diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb new file mode 100644 index 000000000..3dd4316da --- /dev/null +++ b/app/controllers/photos_controller.rb @@ -0,0 +1,52 @@ +class PhotosController < ApplicationController + def index + @user = User.find(params[:user_id]) + @profile = @user.profile + @photo = @user.photos.build + @photos = @user.photos + end + + def create + @user = User.find(params[:user_id]) + if params[:photo] + @photo = @user.photos.build(photo_params) + @photo.save + redirect_to user_photos_path(@user) + else + redirect_to user_photos_path(@user) + end + end + + def show + @photo = Photo.find(params[:id]) + @owner = @photo.user + @profile = @owner.profile + @comment = @photo.comments.build + end + + def update + @photo = Photo.find(params[:id]) + @user = @photo.user + if photo_params[:profile] && current_user.profile_pic + current_user.profile_pic.profile = false + elsif photo_params[:cover] && current_user.profile_pic + current_user.cover_pic.cover =false + end + @photo.update(photo_params) + redirect_to user_photo_path(@user, @photo) + end + + def destroy + @photo = Photo.find(params[:id]) + @user = @photo.user + @photo.destroy + redirect_to user_photos_path(@user) + end + + private + + def photo_params + params.require(:photo).permit(:avatar, :profile, :cover) + end + +end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 3912e2a96..b5b570440 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -16,6 +16,7 @@ def create if @user.save sign_in(@user) + User.delay(run_at: 10.seconds.from_now).send_welcome_email(@user.id) flash[:success] = "Created new user!" redirect_to user_path(@user) else diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 6e09483c7..e2b14e48a 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -12,4 +12,20 @@ def date_separator "#{date_wrap_close}#{date_wrap_open}" end + + def before_photo(idx) + if idx%4==0 + '
'.html_safe + end + end + + def after_photo(idx, photos) + if (idx-3)%4==0 + '
'.html_safe + elsif + idx == photos.count-1 + '
'.html_safe + end + end + end diff --git a/app/helpers/photos_helper.rb b/app/helpers/photos_helper.rb new file mode 100644 index 000000000..0a10d472b --- /dev/null +++ b/app/helpers/photos_helper.rb @@ -0,0 +1,2 @@ +module PhotosHelper +end diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb new file mode 100644 index 000000000..25e7a8d6a --- /dev/null +++ b/app/mailers/user_mailer.rb @@ -0,0 +1,8 @@ +class UserMailer < ApplicationMailer + default :from => "david@danebook.com" + + def welcome(user) + @user=user + mail(to: @user.email, subject: 'Welcome to Danebook!') + end +end diff --git a/app/models/comment.rb b/app/models/comment.rb index 0a13bfe56..e9462782f 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -1,8 +1,8 @@ class Comment < ApplicationRecord - belongs_to :post belongs_to :user - has_many :likes, :as => :likeable - + has_many :likes, :as => :likeable, :dependent => :destroy + belongs_to :commentable, polymorphic:true + validates :body, presence: true def posted_date diff --git a/app/models/photo.rb b/app/models/photo.rb new file mode 100644 index 000000000..2be5dbb0d --- /dev/null +++ b/app/models/photo.rb @@ -0,0 +1,13 @@ +class Photo < ApplicationRecord + belongs_to :user + has_many :likes, :as => :likeable, :dependent => :destroy + has_many :comments, :as => :commentable, :dependent => :destroy + + has_attached_file :avatar, :styles => { medium: "300x300", thumb: "150x150", cover: "800x450", profile: "225x300", comment: "58x54"} + + validates_attachment_content_type :avatar, :content_type => /\Aimage\/.*\Z/ + + def date + updated_at.strftime("%m/%d/%Y") + end +end diff --git a/app/models/post.rb b/app/models/post.rb index 9e7ca492d..71b47b767 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -2,7 +2,7 @@ class Post < ApplicationRecord belongs_to :user validates :body, presence: true has_many :likes, as: :likeable - has_many :comments + has_many :comments, :as => :commentable accepts_nested_attributes_for :comments diff --git a/app/models/profile.rb b/app/models/profile.rb index ed1fe5080..5545e28b0 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -16,5 +16,6 @@ def display_errors(attribute) end message end + end diff --git a/app/models/user.rb b/app/models/user.rb index b8594d0a1..88ca334e0 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -13,7 +13,7 @@ class User < ApplicationRecord accepts_nested_attributes_for :profile has_many :posts - + has_many :photos has_many :likes has_many :comments @@ -52,4 +52,18 @@ def display_errors(attribute) message end + def profile_pic + photos.find_by profile: true + end + + def cover_pic + photos.find_by cover: true + end + + def self.send_welcome_email(id) + user = User.find(id) + UserMailer.welcome(user).deliver + end + + end diff --git a/app/views/friends/index.html.erb b/app/views/friends/index.html.erb index 55950ccc7..9743944db 100644 --- a/app/views/friends/index.html.erb +++ b/app/views/friends/index.html.erb @@ -1,7 +1,7 @@
<%= render :partial => "static_pages/main_nav", :locals => {profile: @profile} %> - <%= render :partial => "static_pages/main_photo", :locals=>{:profile=> @profile} %> + <%= render :partial => "static_pages/main_photo", :locals=>{:profile=> @profile, :user => @user} %>
diff --git a/app/views/photos/_photo_form.html.erb b/app/views/photos/_photo_form.html.erb new file mode 100644 index 000000000..85f63b1be --- /dev/null +++ b/app/views/photos/_photo_form.html.erb @@ -0,0 +1,4 @@ +<%= form_for [user,photo] do |photo_fields| %> + <%= photo_fields.file_field :avatar %> + <%= photo_fields.submit "Add a photo!" %> +<% end %> \ No newline at end of file diff --git a/app/views/photos/index.html.erb b/app/views/photos/index.html.erb new file mode 100644 index 000000000..28f4a5a8a --- /dev/null +++ b/app/views/photos/index.html.erb @@ -0,0 +1,39 @@ +
+ <%= render :partial => "static_pages/main_nav", :locals => {profile: @profile} %> + + <%= render :partial => "static_pages/main_photo", :locals=>{:profile=> @profile, :user => @user} %> + +
+
+ + + <%= render :partial => "static_pages/middle_nav", :locals => {:page=>"photos", :user => @user} %> + +
+
+
+
+ Photos +
+
+
+ + <% if authorized_user? %> +
+
+ <%= render :partial => "photo_form", :locals => {photo: @photo, user: @user} %> +
+
+ <% end %> + <% @photos.each_with_index do |photo, idx| %> + <% unless photo.id == nil %> + <%= before_photo(idx) %> +
+ <%= link_to image_tag(photo.avatar.url(:thumb), class: "img-responsive"), user_photo_path(@user,photo),{title: "Updated #{photo.date}", class: "thumbnail"} %> +
+ <%= after_photo(idx, @photos) %> + <% end %> + <% end %> +
+
+
\ No newline at end of file diff --git a/app/views/photos/show.html.erb b/app/views/photos/show.html.erb new file mode 100644 index 000000000..4953eef43 --- /dev/null +++ b/app/views/photos/show.html.erb @@ -0,0 +1,104 @@ +
+ <%= render :partial => "static_pages/main_nav", :locals => {profile: @profile} %> + + <%= render :partial => "static_pages/main_photo", :locals=>{:profile=> @profile, :user => @owner} %> + +
+
+ + + <%= render :partial => "static_pages/middle_nav", :locals => {:page=>"photos", :user => @owner} %> + +
+
+
+
+ Photos +
+
+
+
+
+ <%= image_tag(@photo.avatar.url(:medium)) %> +
+
+ + + + +<% @photo.comments.each do |comment| %> +<% unless comment.id == nil %> + + <% end %> +<% end %> + +
+
+
+
+
+ \ No newline at end of file diff --git a/app/views/posts/_timeline_bottom.html.erb b/app/views/posts/_timeline_bottom.html.erb index d3e97f5d2..eb45aa631 100644 --- a/app/views/posts/_timeline_bottom.html.erb +++ b/app/views/posts/_timeline_bottom.html.erb @@ -7,9 +7,11 @@ <% posts.each do |post| %> <% if post.id %>
- - <%= image_tag "harry_potter_small.jpg", alt: "harry picture", class: "side-image, small-image" %> - + <% if post.user.profile_pic %> + <%= image_tag post.user.profile_pic.avatar.url(:comment), alt: "friend's picture", class: "side-image small-image" %> + <% else %> + <%= image_tag "wizard_hat.png", alt:"friend's picture", class: "side-image small-image" %> + <% end %>

<%= link_to post.user.profile.full_name, user_path(post.user) %> @@ -39,7 +41,11 @@

<% post.comments.each do |comment| %>