mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-01-31 04:31:01 -05:00
Merge pull request #1766 from Br3nda/upgrade/rails-5-2
Upgrade to Rails 5.2
This commit is contained in:
@@ -1 +1 @@
|
||||
2.4.1
|
||||
2.6.0
|
||||
|
||||
@@ -9,7 +9,7 @@ env:
|
||||
matrix:
|
||||
- GROWSTUFF_ELASTICSEARCH=true RSPEC_TAG=elasticsearch COVERAGE=true
|
||||
- GROWSTUFF_ELASTICSEARCH=false RSPEC_TAG=~elasticsearch COVERAGE=false
|
||||
- STATIC_CHECKS=true
|
||||
# - STATIC_CHECKS=true
|
||||
global:
|
||||
- secure: "Z5TpM2jEX4UCvNePnk/LwltQX48U2u9BRc+Iypr1x9QW2o228QJhPIOH39a8RMUrepGnkQIq9q3ZRUn98RfrJz1yThtlNFL3NmzdQ57gKgjGwfpa0e4Dwj/ZJqV2D84tDGjvdVYLP7zzaYZxQcwk/cgNpzKf/jq97HLNP7CYuf4="
|
||||
- GROWSTUFF_EMAIL="noreply@test.growstuff.org"
|
||||
@@ -19,7 +19,7 @@ before_install:
|
||||
- ./script/install_phantomjs.sh
|
||||
- export PATH=$PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64/bin:$PATH
|
||||
- ./script/install_codeclimate.sh
|
||||
- ./script/install_linters.sh
|
||||
# - ./script/install_linters.sh
|
||||
- VERSION="6.2.3" ./script/install_elasticsearch.sh
|
||||
before_script:
|
||||
- >
|
||||
|
||||
6
Gemfile
6
Gemfile
@@ -2,9 +2,9 @@
|
||||
|
||||
source 'https://rubygems.org'
|
||||
|
||||
ruby '2.4.1'
|
||||
ruby '2.6.0'
|
||||
|
||||
gem 'rails', '5.1.4'
|
||||
gem 'rails', '5.2.2'
|
||||
|
||||
gem 'bundler', '>=1.1.5'
|
||||
|
||||
@@ -43,7 +43,7 @@ gem 'pg', '< 1.0.0' # Upstream bug, see https://github.com/Growst
|
||||
gem 'ruby-units' # for unit conversion
|
||||
gem 'unicorn' # http server
|
||||
|
||||
gem 'comfortable_mexican_sofa', git: 'https://github.com/comfy/comfortable-mexican-sofa', branch: 'rails5.1'
|
||||
gem "comfortable_mexican_sofa", "~> 2.0.0"
|
||||
|
||||
gem 'bootstrap-kaminari-views' # bootstrap views for kaminari
|
||||
gem 'kaminari' # pagination
|
||||
|
||||
143
Gemfile.lock
143
Gemfile.lock
@@ -1,47 +1,26 @@
|
||||
GIT
|
||||
remote: https://github.com/comfy/comfortable-mexican-sofa
|
||||
revision: dca0c7c3669872a00722bb57d3ff0f4995dc4f09
|
||||
branch: rails5.1
|
||||
specs:
|
||||
comfortable_mexican_sofa (1.12.10)
|
||||
active_link_to (>= 1.0.0)
|
||||
bootstrap-sass (>= 3.2.0)
|
||||
bootstrap_form (>= 2.2.0)
|
||||
codemirror-rails (>= 3.0.0)
|
||||
coffee-rails (>= 3.1.0)
|
||||
haml-rails (>= 0.3.0)
|
||||
jquery-rails (>= 3.0.0)
|
||||
jquery-ui-rails (>= 5.0.0)
|
||||
kramdown (>= 1.0.0)
|
||||
paperclip (>= 4.0.0)
|
||||
plupload-rails (>= 1.2.1)
|
||||
rails (>= 5.0.0, < 5.2)
|
||||
rails-i18n (>= 4.0.0)
|
||||
sass-rails (>= 4.0.3)
|
||||
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
remote: https://rails-assets.org/
|
||||
specs:
|
||||
actioncable (5.1.4)
|
||||
actionpack (= 5.1.4)
|
||||
actioncable (5.2.2)
|
||||
actionpack (= 5.2.2)
|
||||
nio4r (~> 2.0)
|
||||
websocket-driver (~> 0.6.1)
|
||||
actionmailer (5.1.4)
|
||||
actionpack (= 5.1.4)
|
||||
actionview (= 5.1.4)
|
||||
activejob (= 5.1.4)
|
||||
websocket-driver (>= 0.6.1)
|
||||
actionmailer (5.2.2)
|
||||
actionpack (= 5.2.2)
|
||||
actionview (= 5.2.2)
|
||||
activejob (= 5.2.2)
|
||||
mail (~> 2.5, >= 2.5.4)
|
||||
rails-dom-testing (~> 2.0)
|
||||
actionpack (5.1.4)
|
||||
actionview (= 5.1.4)
|
||||
activesupport (= 5.1.4)
|
||||
actionpack (5.2.2)
|
||||
actionview (= 5.2.2)
|
||||
activesupport (= 5.2.2)
|
||||
rack (~> 2.0)
|
||||
rack-test (>= 0.6.3)
|
||||
rails-dom-testing (~> 2.0)
|
||||
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
||||
actionview (5.1.4)
|
||||
activesupport (= 5.1.4)
|
||||
actionview (5.2.2)
|
||||
activesupport (= 5.2.2)
|
||||
builder (~> 3.1)
|
||||
erubi (~> 1.4)
|
||||
rails-dom-testing (~> 2.0)
|
||||
@@ -54,23 +33,27 @@ GEM
|
||||
active_utils (3.3.16)
|
||||
activesupport (>= 4.2)
|
||||
i18n
|
||||
activejob (5.1.4)
|
||||
activesupport (= 5.1.4)
|
||||
activejob (5.2.2)
|
||||
activesupport (= 5.2.2)
|
||||
globalid (>= 0.3.6)
|
||||
activemodel (5.1.4)
|
||||
activesupport (= 5.1.4)
|
||||
activerecord (5.1.4)
|
||||
activemodel (= 5.1.4)
|
||||
activesupport (= 5.1.4)
|
||||
arel (~> 8.0)
|
||||
activesupport (5.1.4)
|
||||
activemodel (5.2.2)
|
||||
activesupport (= 5.2.2)
|
||||
activerecord (5.2.2)
|
||||
activemodel (= 5.2.2)
|
||||
activesupport (= 5.2.2)
|
||||
arel (>= 9.0)
|
||||
activestorage (5.2.2)
|
||||
actionpack (= 5.2.2)
|
||||
activerecord (= 5.2.2)
|
||||
marcel (~> 0.3.1)
|
||||
activesupport (5.2.2)
|
||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||
i18n (~> 0.7)
|
||||
i18n (>= 0.7, < 2)
|
||||
minitest (~> 5.1)
|
||||
tzinfo (~> 1.1)
|
||||
addressable (2.5.2)
|
||||
public_suffix (>= 2.0.2, < 4.0)
|
||||
arel (8.0.0)
|
||||
arel (9.0.0)
|
||||
ast (2.4.0)
|
||||
autoprefixer-rails (9.4.3)
|
||||
execjs
|
||||
@@ -91,8 +74,6 @@ GEM
|
||||
bootstrap-sass (3.4.0)
|
||||
autoprefixer-rails (>= 5.2.1)
|
||||
sassc (>= 2.0.0)
|
||||
bootstrap_form (4.0.0)
|
||||
rails (>= 5.0)
|
||||
builder (3.2.3)
|
||||
bullet (5.9.0)
|
||||
activesupport (>= 3.0.0)
|
||||
@@ -116,12 +97,9 @@ GEM
|
||||
chartkick (3.0.1)
|
||||
childprocess (0.9.0)
|
||||
ffi (~> 1.0, >= 1.0.11)
|
||||
climate_control (0.2.0)
|
||||
cliver (0.3.2)
|
||||
codeclimate-test-reporter (1.0.9)
|
||||
simplecov (<= 0.13)
|
||||
codemirror-rails (5.16.0)
|
||||
railties (>= 3.0, < 6.0)
|
||||
coderay (1.1.2)
|
||||
coffee-rails (4.2.2)
|
||||
coffee-script (>= 2.2.0)
|
||||
@@ -130,6 +108,19 @@ GEM
|
||||
coffee-script-source
|
||||
execjs
|
||||
coffee-script-source (1.12.2)
|
||||
comfortable_mexican_sofa (2.0.17)
|
||||
active_link_to (>= 1.0.0)
|
||||
comfy_bootstrap_form (>= 4.0.0)
|
||||
haml-rails (>= 1.0.0)
|
||||
jquery-rails (>= 4.3.1)
|
||||
kramdown (>= 1.0.0)
|
||||
mimemagic (>= 0.3.2)
|
||||
mini_magick (>= 4.8.0)
|
||||
rails (>= 5.2.0)
|
||||
rails-i18n (>= 5.0.0)
|
||||
sass-rails (>= 5.0.0)
|
||||
comfy_bootstrap_form (4.0.6)
|
||||
rails (>= 5.0.0)
|
||||
concurrent-ruby (1.1.4)
|
||||
connection_pool (2.2.2)
|
||||
coveralls (0.8.19)
|
||||
@@ -230,7 +221,7 @@ GEM
|
||||
httparty (0.16.3)
|
||||
mime-types (~> 3.0)
|
||||
multi_xml (>= 0.5.2)
|
||||
i18n (0.9.5)
|
||||
i18n (1.3.0)
|
||||
concurrent-ruby (~> 1.0)
|
||||
i18n-tasks (0.9.28)
|
||||
activesupport (>= 4.0.2)
|
||||
@@ -287,12 +278,15 @@ GEM
|
||||
nokogiri (>= 1.5.9)
|
||||
mail (2.7.1)
|
||||
mini_mime (>= 0.1.1)
|
||||
marcel (0.3.3)
|
||||
mimemagic (~> 0.3.2)
|
||||
memcachier (0.0.2)
|
||||
method_source (0.9.2)
|
||||
mime-types (3.2.2)
|
||||
mime-types-data (~> 3.2015)
|
||||
mime-types-data (3.2018.0812)
|
||||
mimemagic (0.3.3)
|
||||
mini_magick (4.9.2)
|
||||
mini_mime (1.0.1)
|
||||
mini_portile2 (2.4.0)
|
||||
minitest (5.11.3)
|
||||
@@ -329,12 +323,6 @@ GEM
|
||||
omniauth-oauth (~> 1.1)
|
||||
rack
|
||||
orm_adapter (0.5.0)
|
||||
paperclip (6.1.0)
|
||||
activemodel (>= 4.2.0)
|
||||
activesupport (>= 4.2.0)
|
||||
mime-types
|
||||
mimemagic (~> 0.3.0)
|
||||
terrapin (~> 0.6.0)
|
||||
parallel (1.12.1)
|
||||
paranoia (2.4.1)
|
||||
activerecord (>= 4.0, < 5.3)
|
||||
@@ -344,8 +332,6 @@ GEM
|
||||
platform-api (2.2.0)
|
||||
heroics (~> 0.0.25)
|
||||
moneta (~> 1.0.0)
|
||||
plupload-rails (1.2.1)
|
||||
rails (>= 3.1)
|
||||
poltergeist (1.18.1)
|
||||
capybara (>= 2.1, < 4)
|
||||
cliver (~> 0.3.1)
|
||||
@@ -358,17 +344,18 @@ GEM
|
||||
rack
|
||||
rack-test (1.1.0)
|
||||
rack (>= 1.0, < 3)
|
||||
rails (5.1.4)
|
||||
actioncable (= 5.1.4)
|
||||
actionmailer (= 5.1.4)
|
||||
actionpack (= 5.1.4)
|
||||
actionview (= 5.1.4)
|
||||
activejob (= 5.1.4)
|
||||
activemodel (= 5.1.4)
|
||||
activerecord (= 5.1.4)
|
||||
activesupport (= 5.1.4)
|
||||
rails (5.2.2)
|
||||
actioncable (= 5.2.2)
|
||||
actionmailer (= 5.2.2)
|
||||
actionpack (= 5.2.2)
|
||||
actionview (= 5.2.2)
|
||||
activejob (= 5.2.2)
|
||||
activemodel (= 5.2.2)
|
||||
activerecord (= 5.2.2)
|
||||
activestorage (= 5.2.2)
|
||||
activesupport (= 5.2.2)
|
||||
bundler (>= 1.3.0)
|
||||
railties (= 5.1.4)
|
||||
railties (= 5.2.2)
|
||||
sprockets-rails (>= 2.0.0)
|
||||
rails-assets-leaflet (1.3.4)
|
||||
rails-assets-leaflet.markercluster (1.4.1)
|
||||
@@ -390,12 +377,12 @@ GEM
|
||||
rails_stdout_logging
|
||||
rails_serve_static_assets (0.0.5)
|
||||
rails_stdout_logging (0.0.5)
|
||||
railties (5.1.4)
|
||||
actionpack (= 5.1.4)
|
||||
activesupport (= 5.1.4)
|
||||
railties (5.2.2)
|
||||
actionpack (= 5.2.2)
|
||||
activesupport (= 5.2.2)
|
||||
method_source
|
||||
rake (>= 0.8.7)
|
||||
thor (>= 0.18.1, < 2.0)
|
||||
thor (>= 0.19.0, < 2.0)
|
||||
rainbow (3.0.0)
|
||||
raindrops (0.19.0)
|
||||
rake (12.3.2)
|
||||
@@ -486,8 +473,6 @@ GEM
|
||||
tins (~> 1.0)
|
||||
terminal-table (1.8.0)
|
||||
unicode-display_width (~> 1.1, >= 1.1.1)
|
||||
terrapin (0.6.0)
|
||||
climate_control (>= 0.0.3, < 1.0)
|
||||
thor (0.19.4)
|
||||
thread_safe (0.3.6)
|
||||
tilt (2.0.9)
|
||||
@@ -509,7 +494,7 @@ GEM
|
||||
nokogiri (>= 1.2.0)
|
||||
rack (>= 1.0)
|
||||
rack-test (>= 0.5.3)
|
||||
websocket-driver (0.6.5)
|
||||
websocket-driver (0.7.0)
|
||||
websocket-extensions (>= 0.1.0)
|
||||
websocket-extensions (0.1.3)
|
||||
will_paginate (3.1.6)
|
||||
@@ -539,7 +524,7 @@ DEPENDENCIES
|
||||
chartkick
|
||||
codeclimate-test-reporter
|
||||
coffee-rails
|
||||
comfortable_mexican_sofa!
|
||||
comfortable_mexican_sofa (~> 2.0.0)
|
||||
coveralls
|
||||
csv_shaper
|
||||
dalli
|
||||
@@ -584,7 +569,7 @@ DEPENDENCIES
|
||||
poltergeist
|
||||
puma
|
||||
rack-protection (>= 2.0.1)
|
||||
rails (= 5.1.4)
|
||||
rails (= 5.2.2)
|
||||
rails-assets-leaflet.markercluster!
|
||||
rails-controller-testing
|
||||
rails_12factor
|
||||
@@ -607,7 +592,7 @@ DEPENDENCIES
|
||||
xmlrpc
|
||||
|
||||
RUBY VERSION
|
||||
ruby 2.4.1p111
|
||||
ruby 2.6.0p0
|
||||
|
||||
BUNDLED WITH
|
||||
1.16.4
|
||||
1.17.2
|
||||
|
||||
@@ -20,7 +20,7 @@ class ApplicationController < ActionController::Base
|
||||
end
|
||||
|
||||
def not_found
|
||||
render file: 'app/views/errors/404', status: :not_found, layout: false
|
||||
render file: 'app/views/errors/404.html', status: :not_found, layout: false
|
||||
end
|
||||
|
||||
def after_sign_in_path_for(_resource)
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
#!/usr/bin/env ruby
|
||||
require 'pathname'
|
||||
require 'fileutils'
|
||||
include FileUtils
|
||||
|
||||
# path to your application root.
|
||||
APP_ROOT = Pathname.new File.expand_path('..', __dir__)
|
||||
APP_ROOT = File.expand_path('..', __dir__)
|
||||
|
||||
def system!(*args)
|
||||
system(*args) || abort("\n== Command #{args} failed ==")
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
#!/usr/bin/env ruby
|
||||
require 'pathname'
|
||||
require 'fileutils'
|
||||
include FileUtils
|
||||
|
||||
# path to your application root.
|
||||
APP_ROOT = Pathname.new File.expand_path('..', __dir__)
|
||||
APP_ROOT = File.expand_path('..', __dir__)
|
||||
|
||||
def system!(*args)
|
||||
system(*args) || abort("\n== Command #{args} failed ==")
|
||||
@@ -18,6 +17,9 @@ chdir APP_ROOT do
|
||||
system! 'gem install bundler --conservative'
|
||||
system('bundle check') || system!('bundle install')
|
||||
|
||||
# Install JavaScript dependencies if using Yarn
|
||||
# system('bin/yarn')
|
||||
|
||||
puts "\n== Updating database =="
|
||||
system! 'bin/rails db:migrate'
|
||||
|
||||
|
||||
16
bin/yarn
16
bin/yarn
@@ -1,11 +1,9 @@
|
||||
#!/usr/bin/env ruby
|
||||
VENDOR_PATH = File.expand_path('..', __dir__)
|
||||
Dir.chdir(VENDOR_PATH) do
|
||||
begin
|
||||
exec "yarnpkg #{ARGV.join(' ')}"
|
||||
rescue Errno::ENOENT
|
||||
warn "Yarn executable was not detected in the system."
|
||||
warn "Download Yarn at https://yarnpkg.com/en/docs/install"
|
||||
exit 1
|
||||
end
|
||||
APP_ROOT = File.expand_path('..', __dir__)
|
||||
Dir.chdir(APP_ROOT) do
|
||||
exec "yarnpkg", *ARGV
|
||||
rescue Errno::ENOENT
|
||||
warn "Yarn executable was not detected in the system."
|
||||
warn "Download Yarn at https://yarnpkg.com/en/docs/install"
|
||||
exit 1
|
||||
end
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
|
||||
|
||||
require 'bundler/setup' # Set up gems listed in the Gemfile.
|
||||
# require 'bootsnap/setup' # Speed up boot time by caching expensive operations.
|
||||
|
||||
@@ -6,5 +6,5 @@ test:
|
||||
|
||||
production:
|
||||
adapter: redis
|
||||
url: redis://localhost:6379/1
|
||||
url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
|
||||
channel_prefix: growstuff_production
|
||||
|
||||
@@ -13,12 +13,13 @@ Rails.application.configure do
|
||||
config.consider_all_requests_local = true
|
||||
|
||||
# Enable/disable caching. By default caching is disabled.
|
||||
# Run rails dev:cache to toggle caching.
|
||||
if Rails.root.join('tmp', 'caching-dev.txt').exist?
|
||||
config.action_controller.perform_caching = true
|
||||
|
||||
config.cache_store = :memory_store
|
||||
config.public_file_server.headers = {
|
||||
'Cache-Control' => "public, max-age=#{2.days.seconds.to_i}"
|
||||
'Cache-Control' => "public, max-age=#{2.days.to_i}"
|
||||
}
|
||||
else
|
||||
config.action_controller.perform_caching = false
|
||||
@@ -26,6 +27,9 @@ Rails.application.configure do
|
||||
config.cache_store = :null_store
|
||||
end
|
||||
|
||||
# Store uploaded files on the local file system (see config/storage.yml for options)
|
||||
config.active_storage.service = :local
|
||||
|
||||
# Don't care if the mailer can't send.
|
||||
config.action_mailer.raise_delivery_errors = false
|
||||
|
||||
@@ -37,6 +41,9 @@ Rails.application.configure do
|
||||
# Raise an error on page load if there are pending migrations.
|
||||
config.active_record.migration_error = :page_load
|
||||
|
||||
# Highlight code that triggered database queries in logs.
|
||||
config.active_record.verbose_query_logs = true
|
||||
|
||||
# Debug mode disables concatenation and preprocessing of assets.
|
||||
# This option may cause significant delays in view rendering with a large
|
||||
# number of complex assets.
|
||||
|
||||
@@ -105,6 +105,15 @@ Rails.application.configure do
|
||||
config.mapbox_access_token = 'pk.eyJ1IjoiZ3Jvd3N0dWZmIiwiYSI6IkdxMkx4alUifQ.n0igaBsw97s14zMa0lwKCA'
|
||||
|
||||
config.active_job.queue_adapter = :sidekiq
|
||||
# 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
|
||||
|
||||
@@ -15,7 +15,7 @@ Rails.application.configure do
|
||||
# Configure public file server for tests with Cache-Control for performance.
|
||||
config.public_file_server.enabled = true
|
||||
config.public_file_server.headers = {
|
||||
'Cache-Control' => "public, max-age=#{1.hour.seconds.to_i}"
|
||||
'Cache-Control' => "public, max-age=#{1.hour.to_i}"
|
||||
}
|
||||
|
||||
# Show full error reports and disable caching.
|
||||
@@ -27,6 +27,10 @@ Rails.application.configure do
|
||||
|
||||
# Disable request forgery protection in test environment.
|
||||
config.action_controller.allow_forgery_protection = false
|
||||
|
||||
# Store uploaded files on the local file system in a temporary directory
|
||||
config.active_storage.service = :test
|
||||
|
||||
config.action_mailer.perform_caching = false
|
||||
|
||||
# Tell Action Mailer not to deliver emails to the real world.
|
||||
|
||||
25
config/initializers/content_security_policy.rb
Normal file
25
config/initializers/content_security_policy.rb
Normal file
@@ -0,0 +1,25 @@
|
||||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# Define an application-wide content security policy
|
||||
# For further information see the following documentation
|
||||
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
|
||||
|
||||
# Rails.application.config.content_security_policy do |policy|
|
||||
# policy.default_src :self, :https
|
||||
# policy.font_src :self, :https, :data
|
||||
# policy.img_src :self, :https, :data
|
||||
# policy.object_src :none
|
||||
# policy.script_src :self, :https
|
||||
# policy.style_src :self, :https
|
||||
|
||||
# # Specify URI for violation reports
|
||||
# # policy.report_uri "/csp-violation-report-endpoint"
|
||||
# end
|
||||
|
||||
# If you are using UJS then enable automatic nonce generation
|
||||
# Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) }
|
||||
|
||||
# Report CSP violations to a specified URI
|
||||
# For further information see the following documentation:
|
||||
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only
|
||||
# Rails.application.config.content_security_policy_report_only = true
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
# Specify a serializer for the signed and encrypted cookie jars.
|
||||
# Valid options are :json, :marshal, and :hybrid.
|
||||
Rails.application.config.action_dispatch.cookies_serializer = :marshal
|
||||
Rails.application.config.action_dispatch.cookies_serializer = :json
|
||||
|
||||
38
config/initializers/new_framework_defaults_5_2.rb
Normal file
38
config/initializers/new_framework_defaults_5_2.rb
Normal file
@@ -0,0 +1,38 @@
|
||||
# Be sure to restart your server when you modify this file.
|
||||
#
|
||||
# This file contains migration options to ease your Rails 5.2 upgrade.
|
||||
#
|
||||
# Once upgraded flip defaults one by one to migrate to the new default.
|
||||
#
|
||||
# Read the Guide for Upgrading Ruby on Rails for more info on each option.
|
||||
|
||||
# Make Active Record use stable #cache_key alongside new #cache_version method.
|
||||
# This is needed for recyclable cache keys.
|
||||
# Rails.application.config.active_record.cache_versioning = true
|
||||
|
||||
# Use AES-256-GCM authenticated encryption for encrypted cookies.
|
||||
# Also, embed cookie expiry in signed or encrypted cookies for increased security.
|
||||
#
|
||||
# This option is not backwards compatible with earlier Rails versions.
|
||||
# It's best enabled when your entire app is migrated and stable on 5.2.
|
||||
#
|
||||
# Existing cookies will be converted on read then written with the new scheme.
|
||||
# Rails.application.config.action_dispatch.use_authenticated_cookie_encryption = true
|
||||
|
||||
# Use AES-256-GCM authenticated encryption as default cipher for encrypting messages
|
||||
# instead of AES-256-CBC, when use_authenticated_message_encryption is set to true.
|
||||
# Rails.application.config.active_support.use_authenticated_message_encryption = true
|
||||
|
||||
# Add default protection from forgery to ActionController::Base instead of in
|
||||
# ApplicationController.
|
||||
# Rails.application.config.action_controller.default_protect_from_forgery = true
|
||||
|
||||
# Store boolean values are in sqlite3 databases as 1 and 0 instead of 't' and
|
||||
# 'f' after migrating old data.
|
||||
# Rails.application.config.active_record.sqlite3.represent_boolean_as_integer = true
|
||||
|
||||
# Use SHA-1 instead of MD5 to generate non-sensitive digests, such as the ETag header.
|
||||
# Rails.application.config.active_support.use_sha1_digests = true
|
||||
|
||||
# Make `form_with` generate id attributes for any generated HTML tags.
|
||||
# Rails.application.config.action_view.form_with_generates_ids = true
|
||||
@@ -1,4 +1,35 @@
|
||||
---
|
||||
# Files in the config/locales directory are used for internationalization
|
||||
# and are automatically loaded by Rails. If you want to use locales other
|
||||
# than English, add the necessary files in this directory.
|
||||
#
|
||||
# To use the locales, use `I18n.t`:
|
||||
#
|
||||
# I18n.t 'hello'
|
||||
#
|
||||
# In views, this is aliased to just `t`:
|
||||
#
|
||||
# <%= t('hello') %>
|
||||
#
|
||||
# To use a different locale, set it with `I18n.locale`:
|
||||
#
|
||||
# I18n.locale = :es
|
||||
#
|
||||
# This would use the information in config/locales/es.yml.
|
||||
#
|
||||
# The following keys must be escaped otherwise they will not be retrieved by
|
||||
# the default I18n backend:
|
||||
#
|
||||
# true, false, on, off, yes, no
|
||||
#
|
||||
# Instead, surround them with single quotes.
|
||||
#
|
||||
# en:
|
||||
# 'true': 'foo'
|
||||
#
|
||||
# To learn more, please read the Rails Internationalization guide
|
||||
# available at http://guides.rubyonrails.org/i18n.html.
|
||||
|
||||
en:
|
||||
activerecord:
|
||||
models:
|
||||
|
||||
@@ -26,31 +26,9 @@ environment ENV.fetch("RAILS_ENV") { "development" }
|
||||
# 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.
|
||||
# process behavior so workers use less memory.
|
||||
#
|
||||
# preload_app!
|
||||
|
||||
# If you are preloading your application and using Active Record, it's
|
||||
# recommended that you close any connections to the database before workers
|
||||
# are forked to prevent connection leakage.
|
||||
#
|
||||
# before_fork do
|
||||
# ActiveRecord::Base.connection_pool.disconnect! if defined?(ActiveRecord)
|
||||
# end
|
||||
|
||||
# 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 the `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, as 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
|
||||
|
||||
34
config/storage.yml
Normal file
34
config/storage.yml
Normal file
@@ -0,0 +1,34 @@
|
||||
test:
|
||||
service: Disk
|
||||
root: <%= Rails.root.join("tmp/storage") %>
|
||||
|
||||
local:
|
||||
service: Disk
|
||||
root: <%= Rails.root.join("storage") %>
|
||||
|
||||
# Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
|
||||
# amazon:
|
||||
# service: S3
|
||||
# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
|
||||
# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
|
||||
# region: us-east-1
|
||||
# bucket: your_own_bucket
|
||||
|
||||
# Remember not to checkin your GCS keyfile to a repository
|
||||
# google:
|
||||
# service: GCS
|
||||
# project: your_project
|
||||
# credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
|
||||
# bucket: your_own_bucket
|
||||
|
||||
# Use rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key)
|
||||
# microsoft:
|
||||
# service: AzureStorage
|
||||
# storage_account_name: your_account_name
|
||||
# storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %>
|
||||
# container: your_container_name
|
||||
|
||||
# mirror:
|
||||
# service: Mirror
|
||||
# primary: local
|
||||
# mirrors: [ amazon, google, microsoft ]
|
||||
402
package-lock.json
generated
402
package-lock.json
generated
@@ -16,7 +16,7 @@
|
||||
"integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"acorn": "3.3.0"
|
||||
"acorn": "^3.0.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"acorn": {
|
||||
@@ -33,10 +33,10 @@
|
||||
"integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"co": "4.6.0",
|
||||
"fast-deep-equal": "1.0.0",
|
||||
"fast-json-stable-stringify": "2.0.0",
|
||||
"json-schema-traverse": "0.3.1"
|
||||
"co": "^4.6.0",
|
||||
"fast-deep-equal": "^1.0.0",
|
||||
"fast-json-stable-stringify": "^2.0.0",
|
||||
"json-schema-traverse": "^0.3.0"
|
||||
}
|
||||
},
|
||||
"ajv-keywords": {
|
||||
@@ -69,7 +69,7 @@
|
||||
"integrity": "sha1-c9g7wmP4bpf4zE9rrhsOkKfSLIY=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"sprintf-js": "1.0.3"
|
||||
"sprintf-js": "~1.0.2"
|
||||
}
|
||||
},
|
||||
"array-union": {
|
||||
@@ -78,7 +78,7 @@
|
||||
"integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"array-uniq": "1.0.3"
|
||||
"array-uniq": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"array-uniq": {
|
||||
@@ -99,9 +99,9 @@
|
||||
"integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"chalk": "1.1.3",
|
||||
"esutils": "2.0.2",
|
||||
"js-tokens": "3.0.2"
|
||||
"chalk": "^1.1.3",
|
||||
"esutils": "^2.0.2",
|
||||
"js-tokens": "^3.0.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"chalk": {
|
||||
@@ -110,11 +110,11 @@
|
||||
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-styles": "2.2.1",
|
||||
"escape-string-regexp": "1.0.5",
|
||||
"has-ansi": "2.0.0",
|
||||
"strip-ansi": "3.0.1",
|
||||
"supports-color": "2.0.0"
|
||||
"ansi-styles": "^2.2.1",
|
||||
"escape-string-regexp": "^1.0.2",
|
||||
"has-ansi": "^2.0.0",
|
||||
"strip-ansi": "^3.0.0",
|
||||
"supports-color": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"strip-ansi": {
|
||||
@@ -123,7 +123,7 @@
|
||||
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-regex": "2.1.1"
|
||||
"ansi-regex": "^2.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -140,7 +140,7 @@
|
||||
"integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"balanced-match": "1.0.0",
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
@@ -150,7 +150,7 @@
|
||||
"integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"callsites": "0.2.0"
|
||||
"callsites": "^0.2.0"
|
||||
}
|
||||
},
|
||||
"callsites": {
|
||||
@@ -165,9 +165,9 @@
|
||||
"integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-styles": "3.2.0",
|
||||
"escape-string-regexp": "1.0.5",
|
||||
"supports-color": "4.5.0"
|
||||
"ansi-styles": "^3.1.0",
|
||||
"escape-string-regexp": "^1.0.5",
|
||||
"supports-color": "^4.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"ansi-styles": {
|
||||
@@ -176,7 +176,7 @@
|
||||
"integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"color-convert": "1.9.1"
|
||||
"color-convert": "^1.9.0"
|
||||
}
|
||||
},
|
||||
"supports-color": {
|
||||
@@ -185,7 +185,7 @@
|
||||
"integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"has-flag": "2.0.0"
|
||||
"has-flag": "^2.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -209,7 +209,7 @@
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"exit": "0.1.2",
|
||||
"glob": "7.1.2"
|
||||
"glob": "^7.1.1"
|
||||
}
|
||||
},
|
||||
"cli-cursor": {
|
||||
@@ -218,7 +218,7 @@
|
||||
"integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"restore-cursor": "2.0.0"
|
||||
"restore-cursor": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"cli-width": {
|
||||
@@ -245,12 +245,12 @@
|
||||
"integrity": "sha1-lg/VuXVrhFGU6fl6R1bmKGEha3Q=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"coffeescript": "2.0.3",
|
||||
"glob": "7.1.2",
|
||||
"ignore": "3.3.7",
|
||||
"optimist": "0.6.1",
|
||||
"resolve": "0.6.3",
|
||||
"strip-json-comments": "1.0.4"
|
||||
"coffeescript": "~2.0.x",
|
||||
"glob": "^7.0.6",
|
||||
"ignore": "^3.0.9",
|
||||
"optimist": "^0.6.1",
|
||||
"resolve": "^0.6.3",
|
||||
"strip-json-comments": "^1.0.2"
|
||||
}
|
||||
},
|
||||
"coffeescript": {
|
||||
@@ -265,7 +265,7 @@
|
||||
"integrity": "sha1-wSYRB66y8pTr/+ye2eytUppgl+0=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"color-name": "1.1.3"
|
||||
"color-name": "^1.1.1"
|
||||
}
|
||||
},
|
||||
"color-name": {
|
||||
@@ -286,9 +286,9 @@
|
||||
"integrity": "sha1-CqxmL9Ur54lk1VMvaUeE5wEQrPc=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"inherits": "2.0.3",
|
||||
"readable-stream": "2.3.3",
|
||||
"typedarray": "0.0.6"
|
||||
"inherits": "^2.0.3",
|
||||
"readable-stream": "^2.2.2",
|
||||
"typedarray": "^0.0.6"
|
||||
}
|
||||
},
|
||||
"console-browserify": {
|
||||
@@ -297,7 +297,7 @@
|
||||
"integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"date-now": "0.1.4"
|
||||
"date-now": "^0.1.4"
|
||||
}
|
||||
},
|
||||
"core-util-is": {
|
||||
@@ -312,9 +312,9 @@
|
||||
"integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"lru-cache": "4.1.1",
|
||||
"shebang-command": "1.2.0",
|
||||
"which": "1.3.0"
|
||||
"lru-cache": "^4.0.1",
|
||||
"shebang-command": "^1.2.0",
|
||||
"which": "^1.2.9"
|
||||
}
|
||||
},
|
||||
"csslint": {
|
||||
@@ -323,8 +323,8 @@
|
||||
"integrity": "sha1-Gcw+2jIhYP0/cjKvHLKjYOiYouk=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"clone": "2.1.1",
|
||||
"parserlib": "1.1.1"
|
||||
"clone": "~2.1.0",
|
||||
"parserlib": "~1.1.1"
|
||||
}
|
||||
},
|
||||
"date-now": {
|
||||
@@ -354,13 +354,13 @@
|
||||
"integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"globby": "5.0.0",
|
||||
"is-path-cwd": "1.0.0",
|
||||
"is-path-in-cwd": "1.0.0",
|
||||
"object-assign": "4.1.1",
|
||||
"pify": "2.3.0",
|
||||
"pinkie-promise": "2.0.1",
|
||||
"rimraf": "2.6.2"
|
||||
"globby": "^5.0.0",
|
||||
"is-path-cwd": "^1.0.0",
|
||||
"is-path-in-cwd": "^1.0.0",
|
||||
"object-assign": "^4.0.1",
|
||||
"pify": "^2.0.0",
|
||||
"pinkie-promise": "^2.0.0",
|
||||
"rimraf": "^2.2.8"
|
||||
}
|
||||
},
|
||||
"doctrine": {
|
||||
@@ -369,7 +369,7 @@
|
||||
"integrity": "sha512-y0tm5Pq6ywp3qSTZ1vPgVdAnbDEoeoc5wlOHXoY1c4Wug/a7JvqHIl7BTvwodaHmejWkK/9dSb3sCYfyo/om8A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"esutils": "2.0.2"
|
||||
"esutils": "^2.0.2"
|
||||
}
|
||||
},
|
||||
"dom-serializer": {
|
||||
@@ -378,8 +378,8 @@
|
||||
"integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"domelementtype": "1.1.3",
|
||||
"entities": "1.1.1"
|
||||
"domelementtype": "~1.1.1",
|
||||
"entities": "~1.1.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"domelementtype": {
|
||||
@@ -408,7 +408,7 @@
|
||||
"integrity": "sha1-LeWaCCLVAn+r/28DLCsloqir5zg=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"domelementtype": "1.3.0"
|
||||
"domelementtype": "1"
|
||||
}
|
||||
},
|
||||
"domutils": {
|
||||
@@ -417,8 +417,8 @@
|
||||
"integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"dom-serializer": "0.1.0",
|
||||
"domelementtype": "1.3.0"
|
||||
"dom-serializer": "0",
|
||||
"domelementtype": "1"
|
||||
}
|
||||
},
|
||||
"entities": {
|
||||
@@ -439,43 +439,43 @@
|
||||
"integrity": "sha512-Ul6CSGRjKscEyg0X/EeNs7o2XdnbTEOD1OM8cTjmx85RPcBJQrEhZLevhuJZNAE/vS2iVl5Uhgiqf3h5uLMCJQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ajv": "5.5.2",
|
||||
"babel-code-frame": "6.26.0",
|
||||
"chalk": "2.3.0",
|
||||
"concat-stream": "1.6.0",
|
||||
"cross-spawn": "5.1.0",
|
||||
"debug": "3.1.0",
|
||||
"doctrine": "2.0.2",
|
||||
"eslint-scope": "3.7.1",
|
||||
"eslint-visitor-keys": "1.0.0",
|
||||
"espree": "3.5.2",
|
||||
"esquery": "1.0.0",
|
||||
"esutils": "2.0.2",
|
||||
"file-entry-cache": "2.0.0",
|
||||
"functional-red-black-tree": "1.0.1",
|
||||
"glob": "7.1.2",
|
||||
"globals": "11.1.0",
|
||||
"ignore": "3.3.7",
|
||||
"imurmurhash": "0.1.4",
|
||||
"inquirer": "3.3.0",
|
||||
"is-resolvable": "1.0.1",
|
||||
"js-yaml": "3.10.0",
|
||||
"json-stable-stringify-without-jsonify": "1.0.1",
|
||||
"levn": "0.3.0",
|
||||
"lodash": "4.17.4",
|
||||
"minimatch": "3.0.4",
|
||||
"mkdirp": "0.5.1",
|
||||
"natural-compare": "1.4.0",
|
||||
"optionator": "0.8.2",
|
||||
"path-is-inside": "1.0.2",
|
||||
"pluralize": "7.0.0",
|
||||
"progress": "2.0.0",
|
||||
"require-uncached": "1.0.3",
|
||||
"semver": "5.4.1",
|
||||
"strip-ansi": "4.0.0",
|
||||
"strip-json-comments": "2.0.1",
|
||||
"table": "4.0.2",
|
||||
"text-table": "0.2.0"
|
||||
"ajv": "^5.3.0",
|
||||
"babel-code-frame": "^6.22.0",
|
||||
"chalk": "^2.1.0",
|
||||
"concat-stream": "^1.6.0",
|
||||
"cross-spawn": "^5.1.0",
|
||||
"debug": "^3.1.0",
|
||||
"doctrine": "^2.0.2",
|
||||
"eslint-scope": "^3.7.1",
|
||||
"eslint-visitor-keys": "^1.0.0",
|
||||
"espree": "^3.5.2",
|
||||
"esquery": "^1.0.0",
|
||||
"esutils": "^2.0.2",
|
||||
"file-entry-cache": "^2.0.0",
|
||||
"functional-red-black-tree": "^1.0.1",
|
||||
"glob": "^7.1.2",
|
||||
"globals": "^11.0.1",
|
||||
"ignore": "^3.3.3",
|
||||
"imurmurhash": "^0.1.4",
|
||||
"inquirer": "^3.0.6",
|
||||
"is-resolvable": "^1.0.0",
|
||||
"js-yaml": "^3.9.1",
|
||||
"json-stable-stringify-without-jsonify": "^1.0.1",
|
||||
"levn": "^0.3.0",
|
||||
"lodash": "^4.17.4",
|
||||
"minimatch": "^3.0.2",
|
||||
"mkdirp": "^0.5.1",
|
||||
"natural-compare": "^1.4.0",
|
||||
"optionator": "^0.8.2",
|
||||
"path-is-inside": "^1.0.2",
|
||||
"pluralize": "^7.0.0",
|
||||
"progress": "^2.0.0",
|
||||
"require-uncached": "^1.0.3",
|
||||
"semver": "^5.3.0",
|
||||
"strip-ansi": "^4.0.0",
|
||||
"strip-json-comments": "~2.0.1",
|
||||
"table": "^4.0.1",
|
||||
"text-table": "~0.2.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"strip-json-comments": {
|
||||
@@ -498,8 +498,8 @@
|
||||
"integrity": "sha1-PWPD7f2gLgbgGkUq2IyqzHzctug=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"esrecurse": "4.2.0",
|
||||
"estraverse": "4.2.0"
|
||||
"esrecurse": "^4.1.0",
|
||||
"estraverse": "^4.1.1"
|
||||
}
|
||||
},
|
||||
"eslint-visitor-keys": {
|
||||
@@ -514,8 +514,8 @@
|
||||
"integrity": "sha512-sadKeYwaR/aJ3stC2CdvgXu1T16TdYN+qwCpcWbMnGJ8s0zNWemzrvb2GbD4OhmJ/fwpJjudThAlLobGbWZbCQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"acorn": "5.3.0",
|
||||
"acorn-jsx": "3.0.1"
|
||||
"acorn": "^5.2.1",
|
||||
"acorn-jsx": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"esprima": {
|
||||
@@ -530,7 +530,7 @@
|
||||
"integrity": "sha1-z7qLV9f7qT8XKYqKAGoEzaE9gPo=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"estraverse": "4.2.0"
|
||||
"estraverse": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"esrecurse": {
|
||||
@@ -539,8 +539,8 @@
|
||||
"integrity": "sha1-+pVo2Y04I/mkHZHpAtyrnqblsWM=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"estraverse": "4.2.0",
|
||||
"object-assign": "4.1.1"
|
||||
"estraverse": "^4.1.0",
|
||||
"object-assign": "^4.0.1"
|
||||
}
|
||||
},
|
||||
"estraverse": {
|
||||
@@ -567,9 +567,9 @@
|
||||
"integrity": "sha1-PQJqIbf5W1cmOH1CAKwWDTcsO0g=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"chardet": "0.4.2",
|
||||
"iconv-lite": "0.4.19",
|
||||
"tmp": "0.0.33"
|
||||
"chardet": "^0.4.0",
|
||||
"iconv-lite": "^0.4.17",
|
||||
"tmp": "^0.0.33"
|
||||
}
|
||||
},
|
||||
"fast-deep-equal": {
|
||||
@@ -596,7 +596,7 @@
|
||||
"integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"escape-string-regexp": "1.0.5"
|
||||
"escape-string-regexp": "^1.0.5"
|
||||
}
|
||||
},
|
||||
"file-entry-cache": {
|
||||
@@ -605,8 +605,8 @@
|
||||
"integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"flat-cache": "1.3.0",
|
||||
"object-assign": "4.1.1"
|
||||
"flat-cache": "^1.2.1",
|
||||
"object-assign": "^4.0.1"
|
||||
}
|
||||
},
|
||||
"flat-cache": {
|
||||
@@ -615,10 +615,10 @@
|
||||
"integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"circular-json": "0.3.3",
|
||||
"del": "2.2.2",
|
||||
"graceful-fs": "4.1.11",
|
||||
"write": "0.2.1"
|
||||
"circular-json": "^0.3.1",
|
||||
"del": "^2.0.2",
|
||||
"graceful-fs": "^4.1.2",
|
||||
"write": "^0.2.1"
|
||||
}
|
||||
},
|
||||
"fs.realpath": {
|
||||
@@ -639,12 +639,12 @@
|
||||
"integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"fs.realpath": "1.0.0",
|
||||
"inflight": "1.0.6",
|
||||
"inherits": "2.0.3",
|
||||
"minimatch": "3.0.4",
|
||||
"once": "1.4.0",
|
||||
"path-is-absolute": "1.0.1"
|
||||
"fs.realpath": "^1.0.0",
|
||||
"inflight": "^1.0.4",
|
||||
"inherits": "2",
|
||||
"minimatch": "^3.0.4",
|
||||
"once": "^1.3.0",
|
||||
"path-is-absolute": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"globals": {
|
||||
@@ -659,12 +659,12 @@
|
||||
"integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"array-union": "1.0.2",
|
||||
"arrify": "1.0.1",
|
||||
"glob": "7.1.2",
|
||||
"object-assign": "4.1.1",
|
||||
"pify": "2.3.0",
|
||||
"pinkie-promise": "2.0.1"
|
||||
"array-union": "^1.0.1",
|
||||
"arrify": "^1.0.0",
|
||||
"glob": "^7.0.3",
|
||||
"object-assign": "^4.0.1",
|
||||
"pify": "^2.0.0",
|
||||
"pinkie-promise": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"graceful-fs": {
|
||||
@@ -679,7 +679,7 @@
|
||||
"integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-regex": "2.1.1"
|
||||
"ansi-regex": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"has-flag": {
|
||||
@@ -694,11 +694,11 @@
|
||||
"integrity": "sha1-mWwosZFRaovoZQGn15dX5ccMEGg=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"domelementtype": "1.3.0",
|
||||
"domhandler": "2.3.0",
|
||||
"domutils": "1.5.1",
|
||||
"entities": "1.0.0",
|
||||
"readable-stream": "1.1.14"
|
||||
"domelementtype": "1",
|
||||
"domhandler": "2.3",
|
||||
"domutils": "1.5",
|
||||
"entities": "1.0",
|
||||
"readable-stream": "1.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"isarray": {
|
||||
@@ -713,10 +713,10 @@
|
||||
"integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"core-util-is": "1.0.2",
|
||||
"inherits": "2.0.3",
|
||||
"core-util-is": "~1.0.0",
|
||||
"inherits": "~2.0.1",
|
||||
"isarray": "0.0.1",
|
||||
"string_decoder": "0.10.31"
|
||||
"string_decoder": "~0.10.x"
|
||||
}
|
||||
},
|
||||
"string_decoder": {
|
||||
@@ -751,8 +751,8 @@
|
||||
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"once": "1.4.0",
|
||||
"wrappy": "1.0.2"
|
||||
"once": "^1.3.0",
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"inherits": {
|
||||
@@ -767,20 +767,20 @@
|
||||
"integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-escapes": "3.0.0",
|
||||
"chalk": "2.3.0",
|
||||
"cli-cursor": "2.1.0",
|
||||
"cli-width": "2.2.0",
|
||||
"external-editor": "2.1.0",
|
||||
"figures": "2.0.0",
|
||||
"lodash": "4.17.4",
|
||||
"ansi-escapes": "^3.0.0",
|
||||
"chalk": "^2.0.0",
|
||||
"cli-cursor": "^2.1.0",
|
||||
"cli-width": "^2.0.0",
|
||||
"external-editor": "^2.0.4",
|
||||
"figures": "^2.0.0",
|
||||
"lodash": "^4.3.0",
|
||||
"mute-stream": "0.0.7",
|
||||
"run-async": "2.3.0",
|
||||
"rx-lite": "4.0.8",
|
||||
"rx-lite-aggregates": "4.0.8",
|
||||
"string-width": "2.1.1",
|
||||
"strip-ansi": "4.0.0",
|
||||
"through": "2.3.8"
|
||||
"run-async": "^2.2.0",
|
||||
"rx-lite": "^4.0.8",
|
||||
"rx-lite-aggregates": "^4.0.8",
|
||||
"string-width": "^2.1.0",
|
||||
"strip-ansi": "^4.0.0",
|
||||
"through": "^2.3.6"
|
||||
}
|
||||
},
|
||||
"is-fullwidth-code-point": {
|
||||
@@ -801,7 +801,7 @@
|
||||
"integrity": "sha1-ZHdYK4IU1gI0YJRWcAO+ip6sBNw=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"is-path-inside": "1.0.1"
|
||||
"is-path-inside": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"is-path-inside": {
|
||||
@@ -810,7 +810,7 @@
|
||||
"integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"path-is-inside": "1.0.2"
|
||||
"path-is-inside": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"is-promise": {
|
||||
@@ -849,8 +849,8 @@
|
||||
"integrity": "sha1-LnhEFka9RoLpY/IrbpKCPDCcYtw=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"argparse": "1.0.9",
|
||||
"esprima": "4.0.0"
|
||||
"argparse": "^1.0.7",
|
||||
"esprima": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"jshint": {
|
||||
@@ -859,14 +859,14 @@
|
||||
"integrity": "sha1-HnJSkVzmgbQIJ+4UJIxG006apiw=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"cli": "1.0.1",
|
||||
"console-browserify": "1.1.0",
|
||||
"exit": "0.1.2",
|
||||
"htmlparser2": "3.8.3",
|
||||
"lodash": "3.7.0",
|
||||
"minimatch": "3.0.4",
|
||||
"shelljs": "0.3.0",
|
||||
"strip-json-comments": "1.0.4"
|
||||
"cli": "~1.0.0",
|
||||
"console-browserify": "1.1.x",
|
||||
"exit": "0.1.x",
|
||||
"htmlparser2": "3.8.x",
|
||||
"lodash": "3.7.x",
|
||||
"minimatch": "~3.0.2",
|
||||
"shelljs": "0.3.x",
|
||||
"strip-json-comments": "1.0.x"
|
||||
},
|
||||
"dependencies": {
|
||||
"lodash": {
|
||||
@@ -901,8 +901,8 @@
|
||||
"integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"prelude-ls": "1.1.2",
|
||||
"type-check": "0.3.2"
|
||||
"prelude-ls": "~1.1.2",
|
||||
"type-check": "~0.3.2"
|
||||
}
|
||||
},
|
||||
"lodash": {
|
||||
@@ -917,8 +917,8 @@
|
||||
"integrity": "sha1-Yi4y6CSItJJ5EUpPns9F581rulU=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"pseudomap": "1.0.2",
|
||||
"yallist": "2.1.2"
|
||||
"pseudomap": "^1.0.2",
|
||||
"yallist": "^2.1.2"
|
||||
}
|
||||
},
|
||||
"mimic-fn": {
|
||||
@@ -933,7 +933,7 @@
|
||||
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"brace-expansion": "1.1.8"
|
||||
"brace-expansion": "^1.1.7"
|
||||
}
|
||||
},
|
||||
"minimist": {
|
||||
@@ -989,7 +989,7 @@
|
||||
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"wrappy": "1.0.2"
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"onetime": {
|
||||
@@ -998,7 +998,7 @@
|
||||
"integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"mimic-fn": "1.1.0"
|
||||
"mimic-fn": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"optimist": {
|
||||
@@ -1007,8 +1007,8 @@
|
||||
"integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"minimist": "0.0.10",
|
||||
"wordwrap": "0.0.3"
|
||||
"minimist": "~0.0.1",
|
||||
"wordwrap": "~0.0.2"
|
||||
}
|
||||
},
|
||||
"optionator": {
|
||||
@@ -1017,12 +1017,12 @@
|
||||
"integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"deep-is": "0.1.3",
|
||||
"fast-levenshtein": "2.0.6",
|
||||
"levn": "0.3.0",
|
||||
"prelude-ls": "1.1.2",
|
||||
"type-check": "0.3.2",
|
||||
"wordwrap": "1.0.0"
|
||||
"deep-is": "~0.1.3",
|
||||
"fast-levenshtein": "~2.0.4",
|
||||
"levn": "~0.3.0",
|
||||
"prelude-ls": "~1.1.2",
|
||||
"type-check": "~0.3.2",
|
||||
"wordwrap": "~1.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"wordwrap": {
|
||||
@@ -1075,7 +1075,7 @@
|
||||
"integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"pinkie": "2.0.4"
|
||||
"pinkie": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"pluralize": {
|
||||
@@ -1114,13 +1114,13 @@
|
||||
"integrity": "sha1-No8lEtefnUb9/HE0mueHi7weuVw=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"core-util-is": "1.0.2",
|
||||
"inherits": "2.0.3",
|
||||
"isarray": "1.0.0",
|
||||
"process-nextick-args": "1.0.7",
|
||||
"safe-buffer": "5.1.1",
|
||||
"string_decoder": "1.0.3",
|
||||
"util-deprecate": "1.0.2"
|
||||
"core-util-is": "~1.0.0",
|
||||
"inherits": "~2.0.3",
|
||||
"isarray": "~1.0.0",
|
||||
"process-nextick-args": "~1.0.6",
|
||||
"safe-buffer": "~5.1.1",
|
||||
"string_decoder": "~1.0.3",
|
||||
"util-deprecate": "~1.0.1"
|
||||
}
|
||||
},
|
||||
"require-uncached": {
|
||||
@@ -1129,8 +1129,8 @@
|
||||
"integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"caller-path": "0.1.0",
|
||||
"resolve-from": "1.0.1"
|
||||
"caller-path": "^0.1.0",
|
||||
"resolve-from": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"resolve": {
|
||||
@@ -1151,8 +1151,8 @@
|
||||
"integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"onetime": "2.0.1",
|
||||
"signal-exit": "3.0.2"
|
||||
"onetime": "^2.0.0",
|
||||
"signal-exit": "^3.0.2"
|
||||
}
|
||||
},
|
||||
"rimraf": {
|
||||
@@ -1161,7 +1161,7 @@
|
||||
"integrity": "sha1-LtgVDSShbqhlHm1u8PR8QVjOejY=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"glob": "7.1.2"
|
||||
"glob": "^7.0.5"
|
||||
}
|
||||
},
|
||||
"run-async": {
|
||||
@@ -1170,7 +1170,7 @@
|
||||
"integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"is-promise": "2.1.0"
|
||||
"is-promise": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"rx-lite": {
|
||||
@@ -1185,7 +1185,7 @@
|
||||
"integrity": "sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"rx-lite": "4.0.8"
|
||||
"rx-lite": "*"
|
||||
}
|
||||
},
|
||||
"safe-buffer": {
|
||||
@@ -1206,7 +1206,7 @@
|
||||
"integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"shebang-regex": "1.0.0"
|
||||
"shebang-regex": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"shebang-regex": {
|
||||
@@ -1227,7 +1227,7 @@
|
||||
"integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"is-fullwidth-code-point": "2.0.0"
|
||||
"is-fullwidth-code-point": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"sprintf-js": {
|
||||
@@ -1242,8 +1242,8 @@
|
||||
"integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"is-fullwidth-code-point": "2.0.0",
|
||||
"strip-ansi": "4.0.0"
|
||||
"is-fullwidth-code-point": "^2.0.0",
|
||||
"strip-ansi": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"string_decoder": {
|
||||
@@ -1252,7 +1252,7 @@
|
||||
"integrity": "sha1-D8Z9fBQYJd6UKC3VNr7GubzoYKs=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"safe-buffer": "5.1.1"
|
||||
"safe-buffer": "~5.1.0"
|
||||
}
|
||||
},
|
||||
"strip-ansi": {
|
||||
@@ -1261,7 +1261,7 @@
|
||||
"integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-regex": "3.0.0"
|
||||
"ansi-regex": "^3.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"ansi-regex": {
|
||||
@@ -1290,12 +1290,12 @@
|
||||
"integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ajv": "5.5.2",
|
||||
"ajv-keywords": "2.1.1",
|
||||
"chalk": "2.3.0",
|
||||
"lodash": "4.17.4",
|
||||
"ajv": "^5.2.3",
|
||||
"ajv-keywords": "^2.1.0",
|
||||
"chalk": "^2.1.0",
|
||||
"lodash": "^4.17.4",
|
||||
"slice-ansi": "1.0.0",
|
||||
"string-width": "2.1.1"
|
||||
"string-width": "^2.1.1"
|
||||
}
|
||||
},
|
||||
"text-table": {
|
||||
@@ -1316,7 +1316,7 @@
|
||||
"integrity": "sha1-bTQzWIl2jSGyvNoKonfO07G/rfk=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"os-tmpdir": "1.0.2"
|
||||
"os-tmpdir": "~1.0.2"
|
||||
}
|
||||
},
|
||||
"type-check": {
|
||||
@@ -1325,7 +1325,7 @@
|
||||
"integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"prelude-ls": "1.1.2"
|
||||
"prelude-ls": "~1.1.2"
|
||||
}
|
||||
},
|
||||
"typedarray": {
|
||||
@@ -1346,7 +1346,7 @@
|
||||
"integrity": "sha1-/wS9/AEO5UfXgL7DjhrBwnd9JTo=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"isexe": "2.0.0"
|
||||
"isexe": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"wordwrap": {
|
||||
@@ -1367,7 +1367,7 @@
|
||||
"integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"mkdirp": "0.5.1"
|
||||
"mkdirp": "^0.5.1"
|
||||
}
|
||||
},
|
||||
"yallist": {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
checks = [
|
||||
'overcommit -r',
|
||||
# 'overcommit -r',
|
||||
'bundle exec script/check_contributors_md.rb'
|
||||
]
|
||||
|
||||
|
||||
@@ -2,8 +2,11 @@
|
||||
|
||||
if [ "${STATIC_CHECKS}" = "true" ]; then
|
||||
set -euv
|
||||
gem install --update overcommit rubocop haml-lint bundler-audit;
|
||||
npm install;
|
||||
|
||||
gem install --update overcommit haml-lint bundler-audit;
|
||||
|
||||
pip install --upgrade pip;
|
||||
pip install yamllint --user;
|
||||
|
||||
overcommit --install;
|
||||
|
||||
@@ -29,11 +29,9 @@ describe PhotoAssociationsController do
|
||||
|
||||
it do
|
||||
expect do
|
||||
begin
|
||||
delete :destroy, params: valid_params
|
||||
rescue StandardError
|
||||
nil
|
||||
end
|
||||
delete :destroy, params: valid_params
|
||||
rescue StandardError
|
||||
nil
|
||||
end.not_to change(photo.harvests, :count)
|
||||
end
|
||||
|
||||
|
||||
@@ -4,56 +4,55 @@ describe Notification do
|
||||
let(:notification) { FactoryBot.create(:notification) }
|
||||
|
||||
it "belongs to a post" do
|
||||
notification.post.should be_an_instance_of Post
|
||||
expect(notification.post).to be_an_instance_of Post
|
||||
end
|
||||
|
||||
it "belongs to a recipient" do
|
||||
notification.recipient.should be_an_instance_of Member
|
||||
expect(notification.recipient).to be_an_instance_of Member
|
||||
end
|
||||
|
||||
it "belongs to a sender" do
|
||||
notification.sender.should be_an_instance_of Member
|
||||
expect(notification.sender).to be_an_instance_of Member
|
||||
end
|
||||
|
||||
it "has a scope for unread" do
|
||||
Notification.unread.should eq [notification]
|
||||
expect(Notification.unread).to eq [notification]
|
||||
@n2 = FactoryBot.create(:notification, read: true)
|
||||
Notification.unread.should eq [notification]
|
||||
expect(Notification.unread).to eq [notification]
|
||||
@n3 = FactoryBot.create(:notification, read: false)
|
||||
Notification.unread.should include @n3
|
||||
Notification.unread.should include notification
|
||||
expect(Notification.unread).to include @n3
|
||||
expect(Notification.unread).to include notification
|
||||
end
|
||||
|
||||
it "counts unread" do
|
||||
@who = notification.recipient
|
||||
@n2 = FactoryBot.create(:notification, recipient: @who, read: false)
|
||||
@who.notifications.unread_count.should eq 2
|
||||
expect(@who.notifications.unread_count).to eq 2
|
||||
end
|
||||
|
||||
it "sends email if asked" do
|
||||
@notification2 = FactoryBot.create(:notification)
|
||||
@notification2.send_email
|
||||
ActionMailer::Base.deliveries.last.to.should == [@notification2.recipient.email]
|
||||
expect(ActionMailer::Base.deliveries.last.to).to eq [@notification2.recipient.email]
|
||||
end
|
||||
|
||||
it "doesn't send email to people who don't want it" do
|
||||
notification = FactoryBot.create(:no_email_notification)
|
||||
notification.send_email
|
||||
ActionMailer::Base.deliveries.last.to.should_not == [notification.recipient.email]
|
||||
FactoryBot.create(:no_email_notification).send_email
|
||||
expect(ActionMailer::Base.deliveries.last.to).not_to eq [notification.recipient.email]
|
||||
end
|
||||
|
||||
it "sends email on creation" do
|
||||
@notification2 = FactoryBot.create(:notification)
|
||||
ActionMailer::Base.deliveries.last.to.should == [@notification2.recipient.email]
|
||||
expect(ActionMailer::Base.deliveries.last.to).to eq [@notification2.recipient.email]
|
||||
end
|
||||
|
||||
it "replaces missing subjects with (no subject)" do
|
||||
notification = FactoryBot.create(:notification, subject: nil)
|
||||
notification.subject.should == "(no subject)"
|
||||
expect(notification.subject).to eq "(no subject)"
|
||||
end
|
||||
|
||||
it "replaces whitespace-only subjects with (no subject)" do
|
||||
notification = FactoryBot.create(:notification, subject: " ")
|
||||
notification.subject.should == "(no subject)"
|
||||
expect(notification.subject).to eq "(no subject)"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user