From 0bd045e1baab92413b41d7de6df02499a35e57bb Mon Sep 17 00:00:00 2001 From: Gabe Isman Date: Wed, 20 Jun 2018 11:25:35 -0400 Subject: [PATCH 01/59] Turn off asset compilation fallback in production. --- config/environments/production.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/config/environments/production.rb b/config/environments/production.rb index 328bd36f..f6922e0f 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -28,7 +28,8 @@ config.assets.js_compressor = :uglifier # config.assets.css_compressor = :sass - config.assets.compile = true + # Do not fall back to locating/compiling missing assets. + config.assets.compile = false # Asset digests allow you to set far-future HTTP expiration dates on all assets, # yet still be able to expire them through the digest params. @@ -83,7 +84,7 @@ address = ENV["#{provider}_ADDRESS"] || "smtp.sendgrid.net" # if you use SES as your SMTP provider, then your username and password are actually your AWS credentials. user_name = ENV["#{provider}_USERNAME" || (provider == "SES" ? (ENV["AWS_ACCESS_KEY_ID"] || ENV["ACCESS_KEY_ID"] ) : nil) ] # for AWS SES, this is your access key id - password = ENV["#{provider}_PASSWORD" || (provider == "SES" ? (ENV["AWS_SECRET_ACCESS_KEY"] || ENV["SECRET_ACCESS_KEY"] ) : nil) ] # for AWS SES, this is your secret access key + password = ENV["#{provider}_PASSWORD" || (provider == "SES" ? (ENV["AWS_SECRET_ACCESS_KEY"] || ENV["SECRET_ACCESS_KEY"] ) : nil) ] # for AWS SES, this is your secret access key domain = ENV["#{provider}_DOMAIN"] || "heroku.com" port = ENV["#{provider}_PORT"] || "587" From c8e1790750bf6cdf7c10bb1788697b5f2db8216d Mon Sep 17 00:00:00 2001 From: Cameo Hill Date: Tue, 14 Aug 2018 13:38:44 -0700 Subject: [PATCH 02/59] Updated README.md Added emphasis to bookmarklet info link on the README.md file. --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9f7e4520..e8ac52e8 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,13 @@ Read more below, or say hello to the humans behind the project at the [Google Gr ## Alerting journalists to changes on the web -Built and refined in the newsroom of [The Marshall Project](https://www.themarshallproject.org/), Klaxon has provided our journalists with many news tips, giving us early warnings and valuable time to pursue stories. Klaxon has been used and tested by journalists at The Marshall Project, The New York Times, the Texas Tribune, the Associated Press [and elsewhere](NEWSROOMS.md). The public release of this free and open source software was supported by Knight-Mozilla [OpenNews](https://opennews.org/). [If you need help using Klaxon once it's already been set up, [you can find it here.](https://github.com/themarshallproject/klaxon/blob/master/data/help.md)] +Built and refined in the newsroom of [The Marshall Project](https://www.themarshallproject.org/), Klaxon has provided our journalists with many news tips, giving us early warnings and valuable time to pursue stories. Klaxon has been used and tested by journalists at The Marshall Project, The New York Times, the Texas Tribune, the Associated Press [and elsewhere](NEWSROOMS.md). + +The public release of this free and open source software was supported by Knight-Mozilla [OpenNews](https://opennews.org/). + +## How Does Klaxon Work? + +The Klaxon app enables users to "bookmark" portions of a webpage and be notified via email of any changes that may occur to those sections. [Learn more about bookmarklets on the help.md page](https://github.com/themarshallproject/klaxon/blob/master/data/help.md). [![Circle CI](https://circleci.com/gh/themarshallproject/klaxon.svg?style=svg)](https://circleci.com/gh/themarshallproject/klaxon) From 5aa84e9124ff954ccf2707bd73c632de1ed6eec5 Mon Sep 17 00:00:00 2001 From: Cameo Hill Date: Tue, 14 Aug 2018 13:46:00 -0700 Subject: [PATCH 03/59] Changed link in README.md Made new link to help.md a relative URL. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e8ac52e8..e7994630 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ The public release of this free and open source software was supported by Knight ## How Does Klaxon Work? -The Klaxon app enables users to "bookmark" portions of a webpage and be notified via email of any changes that may occur to those sections. [Learn more about bookmarklets on the help.md page](https://github.com/themarshallproject/klaxon/blob/master/data/help.md). +The Klaxon app enables users to "bookmark" portions of a webpage and be notified via email of any changes that may occur to those sections. [Learn more about bookmarklets on the help.md page](data/help.md). [![Circle CI](https://circleci.com/gh/themarshallproject/klaxon.svg?style=svg)](https://circleci.com/gh/themarshallproject/klaxon) From c6d1d5620c917300fc83ee02f02728fff9024187 Mon Sep 17 00:00:00 2001 From: Cameo Hill Date: Wed, 15 Aug 2018 09:07:57 -0700 Subject: [PATCH 04/59] Add Slack to notifications and clean up text. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e7994630..3282d8d8 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ The public release of this free and open source software was supported by Knight ## How Does Klaxon Work? -The Klaxon app enables users to "bookmark" portions of a webpage and be notified via email of any changes that may occur to those sections. [Learn more about bookmarklets on the help.md page](data/help.md). +Klaxon enables users to "bookmark" portions of a webpage and be notified (via email or [Slack](#notify-a-slack-channel) of any changes that may occur to those sections. [Learn more about bookmarklets on the help.md page](data/help.md). [![Circle CI](https://circleci.com/gh/themarshallproject/klaxon.svg?style=svg)](https://circleci.com/gh/themarshallproject/klaxon) From f6f523ee423832f34eba2cee4ee145b5235b373d Mon Sep 17 00:00:00 2001 From: Cameo Hill Date: Wed, 15 Aug 2018 09:21:31 -0700 Subject: [PATCH 05/59] Adding missing parenthesis Parens, parens! --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3282d8d8..6b43ada9 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ The public release of this free and open source software was supported by Knight ## How Does Klaxon Work? -Klaxon enables users to "bookmark" portions of a webpage and be notified (via email or [Slack](#notify-a-slack-channel) of any changes that may occur to those sections. [Learn more about bookmarklets on the help.md page](data/help.md). +Klaxon enables users to "bookmark" portions of a webpage and be notified (via email or [Slack](#notify-a-slack-channel)) of any changes that may occur to those sections. [Learn more about bookmarklets on the help.md page](data/help.md). [![Circle CI](https://circleci.com/gh/themarshallproject/klaxon.svg?style=svg)](https://circleci.com/gh/themarshallproject/klaxon) From 40e3261883fbacc9a1d3c7e4269c191d345f057e Mon Sep 17 00:00:00 2001 From: Cameo Hill Date: Wed, 15 Aug 2018 12:04:47 -0700 Subject: [PATCH 06/59] Adding name to contributors --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 6b43ada9..ddaa6893 100644 --- a/README.md +++ b/README.md @@ -122,6 +122,7 @@ The core contributors to Klaxon have been Ivar Vong, Andy Rossback, Tom Meagher We've been grateful for additional contributions to the project from: * Jackson Gothe-Snape, SBS News +* Cameo Hill * Emily Hopkins * Yolanda Martinez * Jeremy Merrill From e3b7ccf9a08272c42a1959d367cfcb655ece3de9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 27 Aug 2018 20:03:31 +0000 Subject: [PATCH 07/59] [Security] Bump nokogiri from 1.8.2 to 1.8.4 Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.8.2 to 1.8.4. **This update includes security fixes.** - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/master/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.8.2...v1.8.4) Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index d07510cc..b941f704 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -133,7 +133,7 @@ GEM minitest (5.11.3) multi_xml (0.5.5) nenv (0.3.0) - nokogiri (1.8.2) + nokogiri (1.8.4) mini_portile2 (~> 2.3.0) notiffany (0.1.0) nenv (~> 0.1) From f3e8be239a8742459c89c655f0fc653861533b63 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 27 Aug 2018 20:05:46 +0000 Subject: [PATCH 08/59] Bump premailer-rails from 1.9.3 to 1.10.2 Bumps [premailer-rails](https://github.com/fphilipe/premailer-rails) from 1.9.3 to 1.10.2. - [Release notes](https://github.com/fphilipe/premailer-rails/releases) - [Changelog](https://github.com/fphilipe/premailer-rails/blob/master/CHANGELOG.md) - [Commits](https://github.com/fphilipe/premailer-rails/compare/v1.9.3...v1.10.2) Signed-off-by: dependabot[bot] --- Gemfile.lock | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index d07510cc..f65ec21a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -35,7 +35,8 @@ GEM minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) - addressable (2.4.0) + addressable (2.5.2) + public_suffix (>= 2.0.2, < 4.0) arel (6.0.4) aws-sdk (2.6.26) aws-sdk-resources (= 2.6.26) @@ -64,7 +65,7 @@ GEM crack (0.4.3) safe_yaml (~> 1.0.0) crass (1.0.4) - css_parser (1.4.2) + css_parser (1.6.0) addressable database_cleaner (1.5.3) debug_inspector (0.0.2) @@ -102,7 +103,7 @@ GEM httparty (0.13.7) json (~> 1.8) multi_xml (>= 0.5.2) - i18n (0.9.4) + i18n (0.9.5) concurrent-ruby (~> 1.0) jmespath (1.3.1) jquery-rails (4.1.1) @@ -128,27 +129,29 @@ GEM mail (2.7.0) mini_mime (>= 0.1.1) method_source (0.8.2) - mini_mime (1.0.0) + mini_mime (1.0.1) mini_portile2 (2.3.0) minitest (5.11.3) multi_xml (0.5.5) nenv (0.3.0) - nokogiri (1.8.2) + nokogiri (1.8.4) mini_portile2 (~> 2.3.0) notiffany (0.1.0) nenv (~> 0.1) shellany (~> 0.0) pg (0.18.4) - premailer (1.8.6) - css_parser (>= 1.3.6) + premailer (1.11.1) + addressable + css_parser (>= 1.6.0) htmlentities (>= 4.0.0) - premailer-rails (1.9.3) + premailer-rails (1.10.2) actionmailer (>= 3, < 6) premailer (~> 1.7, >= 1.7.9) pry (0.10.3) coderay (~> 1.1.0) method_source (~> 0.8.1) slop (~> 3.4) + public_suffix (3.0.3) puma (3.4.0) rack (1.6.10) rack-cache (1.6.1) From a4c6cd34e81fd8df7f521980561d009ea989a556 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 27 Aug 2018 20:07:43 +0000 Subject: [PATCH 09/59] Bump sdoc from 0.4.1 to 1.0.0 Bumps [sdoc](https://github.com/zzak/sdoc) from 0.4.1 to 1.0.0. - [Release notes](https://github.com/zzak/sdoc/releases) - [Changelog](https://github.com/zzak/sdoc/blob/master/CHANGELOG.md) - [Commits](https://github.com/zzak/sdoc/compare/v0.4.1...v1.0.0) Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Gemfile b/Gemfile index 2dc6736b..d6dcf8c0 100644 --- a/Gemfile +++ b/Gemfile @@ -10,7 +10,7 @@ gem 'therubyracer' gem 'dotenv' gem 'jquery-rails' gem 'turbolinks' -gem 'sdoc', '~> 0.4.0', group: :doc +gem 'sdoc', '~> 1.0.0', group: :doc gem 'rack-cache' gem 'bcrypt', '~> 3.1.7' diff --git a/Gemfile.lock b/Gemfile.lock index d07510cc..61a80757 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -190,8 +190,7 @@ GEM rb-fsevent (0.9.7) rb-inotify (0.9.7) ffi (>= 0.5.0) - rdoc (4.2.2) - json (~> 1.4) + rdoc (6.0.4) ref (2.0.0) rspec (3.4.0) rspec-core (~> 3.4.0) @@ -223,9 +222,8 @@ GEM sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) tilt (>= 1.1, < 3) - sdoc (0.4.1) - json (~> 1.7, >= 1.7.7) - rdoc (~> 4.0) + sdoc (1.0.0) + rdoc (>= 5.0) shellany (0.0.1) simple_form (3.2.1) actionpack (> 4, < 5.1) @@ -296,7 +294,7 @@ DEPENDENCIES rails_12factor rspec-rails (~> 3.0) sass-rails (~> 5.0) - sdoc (~> 0.4.0) + sdoc (~> 1.0.0) simple_form (~> 3.2) sinatra spring From 37199d6f690ff85918174b8a4f8266326b54a5b8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 27 Aug 2018 20:16:57 +0000 Subject: [PATCH 10/59] Bump dotenv from 2.1.1 to 2.5.0 Bumps [dotenv](https://github.com/bkeepers/dotenv) from 2.1.1 to 2.5.0. - [Release notes](https://github.com/bkeepers/dotenv/releases) - [Changelog](https://github.com/bkeepers/dotenv/blob/master/Changelog.md) - [Commits](https://github.com/bkeepers/dotenv/compare/v2.1.1...v2.5.0) Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 229a3ccc..f4771240 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -71,7 +71,7 @@ GEM diff-lcs (1.2.5) diffy (3.1.0) docile (1.1.5) - dotenv (2.1.1) + dotenv (2.5.0) erubis (2.7.0) execjs (2.7.0) factory_girl (4.7.0) From cc1f7260c841a05c6c13985818041082883b992f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 28 Aug 2018 10:30:31 +0000 Subject: [PATCH 11/59] Bump puma from 3.4.0 to 3.12.0 Bumps [puma](https://github.com/puma/puma) from 3.4.0 to 3.12.0. - [Release notes](https://github.com/puma/puma/releases) - [Changelog](https://github.com/puma/puma/blob/master/History.md) - [Commits](https://github.com/puma/puma/compare/v3.4.0...v3.12.0) Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index d6dcf8c0..42e846cb 100644 --- a/Gemfile +++ b/Gemfile @@ -14,7 +14,7 @@ gem 'sdoc', '~> 1.0.0', group: :doc gem 'rack-cache' gem 'bcrypt', '~> 3.1.7' -gem 'puma', '~> 3.2' +gem 'puma', '~> 3.12' gem 'rails_12factor' gem 'simple_form', '~> 3.2' diff --git a/Gemfile.lock b/Gemfile.lock index e7b1745c..8b886c8b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -152,7 +152,7 @@ GEM method_source (~> 0.8.1) slop (~> 3.4) public_suffix (3.0.3) - puma (3.4.0) + puma (3.12.0) rack (1.6.10) rack-cache (1.6.1) rack (>= 0.4) @@ -291,7 +291,7 @@ DEPENDENCIES letter_opener pg (~> 0.15) premailer-rails - puma (~> 3.2) + puma (~> 3.12) rack-cache rails (~> 4.2) rails_12factor From 5ce62199f6fd6e9825039540d56431716311f189 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 28 Aug 2018 10:31:07 +0000 Subject: [PATCH 12/59] Bump database_cleaner from 1.5.3 to 1.7.0 Bumps [database_cleaner](https://github.com/DatabaseCleaner/database_cleaner) from 1.5.3 to 1.7.0. - [Release notes](https://github.com/DatabaseCleaner/database_cleaner/releases) - [Changelog](https://github.com/DatabaseCleaner/database_cleaner/blob/master/History.rdoc) - [Commits](https://github.com/DatabaseCleaner/database_cleaner/compare/v1.5.3...v1.7.0) Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index e7b1745c..99b0ee68 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -67,7 +67,7 @@ GEM crass (1.0.4) css_parser (1.6.0) addressable - database_cleaner (1.5.3) + database_cleaner (1.7.0) debug_inspector (0.0.2) diff-lcs (1.2.5) diffy (3.1.0) From 1819513e838bec7ac5f523cead57a55694b0d5ef Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 28 Aug 2018 10:31:24 +0000 Subject: [PATCH 13/59] Bump sinatra from 1.4.7 to 1.4.8 Bumps [sinatra](https://github.com/sinatra/sinatra) from 1.4.7 to 1.4.8. - [Release notes](https://github.com/sinatra/sinatra/releases) - [Changelog](https://github.com/sinatra/sinatra/blob/master/CHANGELOG.md) - [Commits](https://github.com/sinatra/sinatra/compare/v1.4.7...v1.4.8) Signed-off-by: dependabot[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index e7b1745c..f64dc99a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -236,7 +236,7 @@ GEM json (~> 1.8) simplecov-html (~> 0.10.0) simplecov-html (0.10.0) - sinatra (1.4.7) + sinatra (1.4.8) rack (~> 1.5) rack-protection (~> 1.4) tilt (>= 1.3, < 3) @@ -254,7 +254,7 @@ GEM ref thor (0.20.0) thread_safe (0.3.6) - tilt (2.0.5) + tilt (2.0.8) turbolinks (2.5.3) coffee-rails tzinfo (1.2.5) From cbdeca629b5f6dd9f372c200a2054b0667496c42 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 28 Aug 2018 10:31:46 +0000 Subject: [PATCH 14/59] Bump sass-rails from 5.0.4 to 5.0.7 Bumps [sass-rails](https://github.com/rails/sass-rails) from 5.0.4 to 5.0.7. - [Release notes](https://github.com/rails/sass-rails/releases) - [Commits](https://github.com/rails/sass-rails/compare/v5.0.4...v5.0.7) Signed-off-by: dependabot[bot] --- Gemfile.lock | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index e7b1745c..d77c1b56 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -189,7 +189,7 @@ GEM activesupport (= 4.2.10) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) - rake (12.3.0) + rake (12.3.1) rb-fsevent (0.9.7) rb-inotify (0.9.7) ffi (>= 0.5.0) @@ -218,9 +218,13 @@ GEM rspec-support (3.4.1) ruby_dep (1.3.1) safe_yaml (1.0.4) - sass (3.4.22) - sass-rails (5.0.4) - railties (>= 4.0.0, < 5.0) + sass (3.5.7) + sass-listen (~> 4.0.0) + sass-listen (4.0.0) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + sass-rails (5.0.7) + railties (>= 4.0.0, < 6) sass (~> 3.1) sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) @@ -254,7 +258,7 @@ GEM ref thor (0.20.0) thread_safe (0.3.6) - tilt (2.0.5) + tilt (2.0.8) turbolinks (2.5.3) coffee-rails tzinfo (1.2.5) From 4a7416d4d377f7eb08e53e092b276df6db35abc4 Mon Sep 17 00:00:00 2001 From: Grey Baker Date: Tue, 28 Aug 2018 11:51:27 +0100 Subject: [PATCH 15/59] Replace FactoryGirl with FactoryBot --- Gemfile | 2 +- Gemfile.lock | 16 ++++++++-------- spec/factories.rb | 16 ++++++++-------- spec/rails_helper.rb | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Gemfile b/Gemfile index d6dcf8c0..d0c18df2 100644 --- a/Gemfile +++ b/Gemfile @@ -33,7 +33,7 @@ group :development, :test do gem 'byebug' gem 'rspec-rails', '~> 3.0' gem 'guard-rspec', require: false - gem 'factory_girl_rails', '~> 4.0' + gem 'factory_bot_rails', '~> 4.0' gem 'database_cleaner' gem 'sinatra' end diff --git a/Gemfile.lock b/Gemfile.lock index e7b1745c..8ea39b3c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -75,10 +75,10 @@ GEM dotenv (2.5.0) erubis (2.7.0) execjs (2.7.0) - factory_girl (4.7.0) + factory_bot (4.11.0) activesupport (>= 3.0.0) - factory_girl_rails (4.7.0) - factory_girl (~> 4.7.0) + factory_bot_rails (4.11.0) + factory_bot (~> 4.11.0) railties (>= 3.0.0) ffi (1.9.10) formatador (0.2.5) @@ -117,7 +117,7 @@ GEM addressable (~> 2.3) letter_opener (1.4.1) launchy (~> 2.2) - libv8 (3.16.14.15) + libv8 (3.16.14.19) listen (3.1.5) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) @@ -249,8 +249,8 @@ GEM actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) - therubyracer (0.12.2) - libv8 (~> 3.16.14.0) + therubyracer (0.12.3) + libv8 (~> 3.16.14.15) ref thor (0.20.0) thread_safe (0.3.6) @@ -282,7 +282,7 @@ DEPENDENCIES database_cleaner diffy dotenv - factory_girl_rails (~> 4.0) + factory_bot_rails (~> 4.0) guard-rspec httparty jquery-rails @@ -311,4 +311,4 @@ RUBY VERSION ruby 2.3.4p301 BUNDLED WITH - 1.14.6 + 1.16.3 diff --git a/spec/factories.rb b/spec/factories.rb index 35935b51..dcaf2115 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :page_snapshot do page { create(:page) } @@ -9,12 +9,12 @@ end factory :slack_integration do - channel "#klaxon" - webhook_url "http://test-webhook.com/test-webhook" + channel { "#klaxon" } + webhook_url { "http://test-webhook.com/test-webhook" } end factory :sqs_integration do - queue_url "https://sqs.us-east-1.amazonaws.com/1234567890/klaxon-sqs-q-test" + queue_url { "https://sqs.us-east-1.amazonaws.com/1234567890/klaxon-sqs-q-test" } end factory :change do @@ -27,13 +27,13 @@ end factory :page do - name "nyt homepage" - url "http://www.nytimes.com/" - css_selector "h2.story-heading" + name { "nyt homepage" } + url { "http://www.nytimes.com/" } + css_selector { "h2.story-heading" } trait :with_snapshots do transient do - snapshot_count 2 + snapshot_count { 2 } end after(:create) do |page, evaluator| create_list(:page_snapshot, evaluator.snapshot_count, page: page) diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 9e97b0cc..eee58291 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -37,7 +37,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 FactoryBot::Syntax::Methods config.use_transactional_fixtures = false From f2e04ce5f40fae908308b33e1409cc7761ce90a3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 29 Aug 2018 10:28:23 +0000 Subject: [PATCH 16/59] Bump webmock from 2.1.0 to 3.4.2 Bumps [webmock](https://github.com/bblimke/webmock) from 2.1.0 to 3.4.2. - [Release notes](https://github.com/bblimke/webmock/releases) - [Changelog](https://github.com/bblimke/webmock/blob/master/CHANGELOG.md) - [Commits](https://github.com/bblimke/webmock/compare/v2.1.0...v3.4.2) Signed-off-by: dependabot[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 46cd497c..dcc1b2f9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -98,7 +98,7 @@ GEM guard (~> 2.1) guard-compat (~> 1.1) rspec (>= 2.99.0, < 4.0) - hashdiff (0.3.0) + hashdiff (0.3.7) htmlentities (4.3.4) httparty (0.13.7) json (~> 1.8) @@ -270,7 +270,7 @@ GEM binding_of_caller (>= 0.7.2) railties (>= 4.0) sprockets-rails (>= 2.0, < 4.0) - webmock (2.1.0) + webmock (3.4.2) addressable (>= 2.3.6) crack (>= 0.3.2) hashdiff From a5b2eef9812e5250932fb03de6a6941359a003cb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 29 Aug 2018 10:28:32 +0000 Subject: [PATCH 17/59] Bump guard-rspec from 4.7.2 to 4.7.3 Bumps [guard-rspec](https://github.com/guard/guard-rspec) from 4.7.2 to 4.7.3. - [Release notes](https://github.com/guard/guard-rspec/releases) - [Commits](https://github.com/guard/guard-rspec/compare/v4.7.2...v4.7.3) Signed-off-by: dependabot[bot] --- Gemfile.lock | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 46cd497c..0f605b8b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -53,7 +53,7 @@ GEM byebug (9.0.5) codeclimate-test-reporter (0.5.2) simplecov (>= 0.7.1, < 1.0.0) - coderay (1.1.1) + coderay (1.1.2) coffee-rails (4.1.1) coffee-script (>= 2.2.0) railties (>= 4.0.0, < 5.1.x) @@ -69,7 +69,7 @@ GEM addressable database_cleaner (1.7.0) debug_inspector (0.0.2) - diff-lcs (1.2.5) + diff-lcs (1.3) diffy (3.1.0) docile (1.1.5) dotenv (2.5.0) @@ -80,21 +80,21 @@ GEM factory_bot_rails (4.11.0) factory_bot (~> 4.11.0) railties (>= 3.0.0) - ffi (1.9.10) + ffi (1.9.25) formatador (0.2.5) globalid (0.4.1) activesupport (>= 4.2.0) - guard (2.14.0) + guard (2.14.2) formatador (>= 0.2.4) listen (>= 2.7, < 4.0) - lumberjack (~> 1.0) + lumberjack (>= 1.0.12, < 2.0) nenv (~> 0.1) notiffany (~> 0.0) pry (>= 0.9.12) shellany (~> 0.0) thor (>= 0.18.1) guard-compat (1.2.1) - guard-rspec (4.7.2) + guard-rspec (4.7.3) guard (~> 2.1) guard-compat (~> 1.1) rspec (>= 2.99.0, < 4.0) @@ -125,10 +125,10 @@ GEM loofah (2.2.2) crass (~> 1.0.2) nokogiri (>= 1.5.9) - lumberjack (1.0.10) + lumberjack (1.0.13) mail (2.7.0) mini_mime (>= 0.1.1) - method_source (0.8.2) + method_source (0.9.0) mini_mime (1.0.1) mini_portile2 (2.3.0) minitest (5.11.3) @@ -136,7 +136,7 @@ GEM nenv (0.3.0) nokogiri (1.8.4) mini_portile2 (~> 2.3.0) - notiffany (0.1.0) + notiffany (0.1.1) nenv (~> 0.1) shellany (~> 0.0) pg (0.18.4) @@ -147,10 +147,9 @@ GEM premailer-rails (1.10.2) actionmailer (>= 3, < 6) premailer (~> 1.7, >= 1.7.9) - pry (0.10.3) + pry (0.11.3) coderay (~> 1.1.0) - method_source (~> 0.8.1) - slop (~> 3.4) + method_source (~> 0.9.0) public_suffix (3.0.3) puma (3.12.0) rack (1.6.10) @@ -190,9 +189,9 @@ GEM rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) rake (12.3.1) - rb-fsevent (0.9.7) - rb-inotify (0.9.7) - ffi (>= 0.5.0) + rb-fsevent (0.10.3) + rb-inotify (0.9.10) + ffi (>= 0.5.0, < 2) rdoc (6.0.4) ref (2.0.0) rspec (3.4.0) @@ -216,7 +215,7 @@ GEM rspec-mocks (~> 3.4.0) rspec-support (~> 3.4.0) rspec-support (3.4.1) - ruby_dep (1.3.1) + ruby_dep (1.5.0) safe_yaml (1.0.4) sass (3.5.7) sass-listen (~> 4.0.0) @@ -244,7 +243,6 @@ GEM rack (~> 1.5) rack-protection (~> 1.4) tilt (>= 1.3, < 3) - slop (3.6.0) spring (1.7.1) sprockets (3.7.2) concurrent-ruby (~> 1.0) From ac460e7ef3b7c04b28eea1a1eaea9f655bd30463 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Thu, 30 Aug 2018 10:18:59 +0000 Subject: [PATCH 18/59] Bump uglifier from 3.0.0 to 4.1.18 Bumps [uglifier](https://github.com/lautis/uglifier) from 3.0.0 to 4.1.18. - [Release notes](https://github.com/lautis/uglifier/releases) - [Changelog](https://github.com/lautis/uglifier/blob/master/CHANGELOG.md) - [Commits](https://github.com/lautis/uglifier/compare/v3.0.0...v4.1.18) Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 46cd497c..5b9e5833 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -263,7 +263,7 @@ GEM coffee-rails tzinfo (1.2.5) thread_safe (~> 0.1) - uglifier (3.0.0) + uglifier (4.1.18) execjs (>= 0.3.0, < 3) web-console (2.3.0) activemodel (>= 4.0) From adf8cccec70c6908cdeb1d7f973adfc1a6f09281 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 4 Sep 2018 16:06:19 +0000 Subject: [PATCH 19/59] Bump web-console from 2.3.0 to 3.3.0 Bumps [web-console](https://github.com/rails/web-console) from 2.3.0 to 3.3.0. - [Release notes](https://github.com/rails/web-console/releases) - [Changelog](https://github.com/rails/web-console/blob/master/CHANGELOG.markdown) - [Commits](https://github.com/rails/web-console/compare/v2.3.0...v3.3.0) Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/Gemfile b/Gemfile index 2082d890..2feb3541 100644 --- a/Gemfile +++ b/Gemfile @@ -45,6 +45,6 @@ end group :development do gem 'letter_opener' - gem 'web-console', '~> 2.0' + gem 'web-console', '~> 3.3' gem 'spring' end diff --git a/Gemfile.lock b/Gemfile.lock index ecce62c7..d857f917 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -47,8 +47,6 @@ GEM aws-sdk-core (= 2.6.26) aws-sigv4 (1.0.0) bcrypt (3.1.11) - binding_of_caller (0.7.2) - debug_inspector (>= 0.0.1) builder (3.2.3) byebug (9.0.5) codeclimate-test-reporter (0.5.2) @@ -68,7 +66,7 @@ GEM css_parser (1.6.0) addressable database_cleaner (1.7.0) - debug_inspector (0.0.2) + debug_inspector (0.0.3) diff-lcs (1.3) diffy (3.1.0) docile (1.1.5) @@ -263,11 +261,10 @@ GEM thread_safe (~> 0.1) uglifier (3.0.0) execjs (>= 0.3.0, < 3) - web-console (2.3.0) - activemodel (>= 4.0) - binding_of_caller (>= 0.7.2) - railties (>= 4.0) - sprockets-rails (>= 2.0, < 4.0) + web-console (3.3.0) + activemodel (>= 4.2) + debug_inspector + railties (>= 4.2) webmock (3.4.2) addressable (>= 2.3.6) crack (>= 0.3.2) @@ -306,7 +303,7 @@ DEPENDENCIES therubyracer turbolinks uglifier (>= 1.3.0) - web-console (~> 2.0) + web-console (~> 3.3) webmock RUBY VERSION From e2dc3dc475afac681c5ac4969ce8ba6c21924848 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 4 Sep 2018 16:06:34 +0000 Subject: [PATCH 20/59] Bump httparty from 0.13.7 to 0.16.2 Bumps [httparty](https://github.com/jnunemaker/httparty) from 0.13.7 to 0.16.2. - [Release notes](https://github.com/jnunemaker/httparty/releases) - [Changelog](https://github.com/jnunemaker/httparty/blob/master/Changelog.md) - [Commits](https://github.com/jnunemaker/httparty/compare/v0.13.7...v0.16.2) Signed-off-by: dependabot[bot] --- Gemfile.lock | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index ecce62c7..c140c01d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -100,8 +100,7 @@ GEM rspec (>= 2.99.0, < 4.0) hashdiff (0.3.7) htmlentities (4.3.4) - httparty (0.13.7) - json (~> 1.8) + httparty (0.16.2) multi_xml (>= 0.5.2) i18n (0.9.5) concurrent-ruby (~> 1.0) @@ -132,7 +131,7 @@ GEM mini_mime (1.0.1) mini_portile2 (2.3.0) minitest (5.11.3) - multi_xml (0.5.5) + multi_xml (0.6.0) nenv (0.3.0) nokogiri (1.8.4) mini_portile2 (~> 2.3.0) From eb8e66ce338ac159a9dc92aeaa0ed841a759361a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 4 Sep 2018 16:06:46 +0000 Subject: [PATCH 21/59] Bump spring from 1.7.1 to 2.0.2 Bumps [spring](https://github.com/rails/spring) from 1.7.1 to 2.0.2. - [Release notes](https://github.com/rails/spring/releases) - [Changelog](https://github.com/rails/spring/blob/master/CHANGELOG.md) - [Commits](https://github.com/rails/spring/compare/v1.7.1...v2.0.2) Signed-off-by: dependabot[bot] --- Gemfile.lock | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index ecce62c7..f56304ac 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -243,7 +243,8 @@ GEM rack (~> 1.5) rack-protection (~> 1.4) tilt (>= 1.3, < 3) - spring (1.7.1) + spring (2.0.2) + activesupport (>= 4.2) sprockets (3.7.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) From 8a4b5a19e4e7041824c4c5a37328ca773e23db5f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 5 Sep 2018 10:38:29 +0000 Subject: [PATCH 22/59] Bump bcrypt from 3.1.11 to 3.1.12 Bumps [bcrypt](https://github.com/codahale/bcrypt-ruby) from 3.1.11 to 3.1.12. - [Release notes](https://github.com/codahale/bcrypt-ruby/releases) - [Changelog](https://github.com/codahale/bcrypt-ruby/blob/master/CHANGELOG) - [Commits](https://github.com/codahale/bcrypt-ruby/compare/v3.1.11...v3.1.12) Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 2feb3541..2ad340b2 100644 --- a/Gemfile +++ b/Gemfile @@ -13,7 +13,7 @@ gem 'turbolinks' gem 'sdoc', '~> 1.0.0', group: :doc gem 'rack-cache' -gem 'bcrypt', '~> 3.1.7' +gem 'bcrypt', '~> 3.1.12' gem 'puma', '~> 3.12' gem 'rails_12factor' diff --git a/Gemfile.lock b/Gemfile.lock index 8931efe1..1613586a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -46,7 +46,7 @@ GEM aws-sdk-resources (2.6.26) aws-sdk-core (= 2.6.26) aws-sigv4 (1.0.0) - bcrypt (3.1.11) + bcrypt (3.1.12) builder (3.2.3) byebug (9.0.5) codeclimate-test-reporter (0.5.2) @@ -275,7 +275,7 @@ PLATFORMS DEPENDENCIES aws-sdk (~> 2.0) - bcrypt (~> 3.1.7) + bcrypt (~> 3.1.12) byebug codeclimate-test-reporter database_cleaner From 642be90ee0d5853fde98173fb7bf044f56f22684 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 5 Sep 2018 10:39:36 +0000 Subject: [PATCH 23/59] Bump diffy from 3.1.0 to 3.2.1 Bumps [diffy](https://github.com/samg/diffy) from 3.1.0 to 3.2.1. - [Release notes](https://github.com/samg/diffy/releases) - [Changelog](https://github.com/samg/diffy/blob/master/CHANGELOG) - [Commits](https://github.com/samg/diffy/commits) Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 8931efe1..d0d2a981 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -68,7 +68,7 @@ GEM database_cleaner (1.7.0) debug_inspector (0.0.3) diff-lcs (1.3) - diffy (3.1.0) + diffy (3.2.1) docile (1.1.5) dotenv (2.5.0) erubis (2.7.0) From 4e67292b84adffab07813e5cf6d0d1a1f4b1d937 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 5 Sep 2018 10:39:52 +0000 Subject: [PATCH 24/59] Bump pg from 0.18.4 to 0.21.0 Bumps [pg](https://bitbucket.org/ged/ruby-pg) from 0.18.4 to 0.21.0. - [Changelog](https://bitbucket.org/ged/ruby-pg/src/master/History.rdoc) - [Commits](https://bitbucket.org/ged/ruby-pg/branches/compare/v0.21.0..v0.18.4) Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 2feb3541..0ef127a1 100644 --- a/Gemfile +++ b/Gemfile @@ -2,7 +2,7 @@ source 'https://rubygems.org' ruby '2.3.4' gem 'rails', '~> 4.2' -gem 'pg', '~> 0.15' +gem 'pg', '~> 0.21' gem 'sass-rails', '~> 5.0' gem 'uglifier', '>= 1.3.0' gem 'therubyracer' diff --git a/Gemfile.lock b/Gemfile.lock index 8931efe1..5b527168 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -136,7 +136,7 @@ GEM notiffany (0.1.1) nenv (~> 0.1) shellany (~> 0.0) - pg (0.18.4) + pg (0.21.0) premailer (1.11.1) addressable css_parser (>= 1.6.0) @@ -288,7 +288,7 @@ DEPENDENCIES jwt kramdown letter_opener - pg (~> 0.15) + pg (~> 0.21) premailer-rails puma (~> 3.12) rack-cache From 942677eeebecbc3dea1a86c6faed776480c42260 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 5 Sep 2018 10:39:59 +0000 Subject: [PATCH 25/59] Bump jwt from 1.5.4 to 2.1.0 Bumps [jwt](https://github.com/jwt/ruby-jwt) from 1.5.4 to 2.1.0. - [Release notes](https://github.com/jwt/ruby-jwt/releases) - [Changelog](https://github.com/jwt/ruby-jwt/blob/master/CHANGELOG.md) - [Commits](https://github.com/jwt/ruby-jwt/compare/v1.5.4...v2.1.0) Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 8931efe1..271c0301 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -108,7 +108,7 @@ GEM railties (>= 4.2.0) thor (>= 0.14, < 2.0) json (1.8.6) - jwt (1.5.4) + jwt (2.1.0) kramdown (1.11.1) launchy (2.4.3) addressable (~> 2.3) From 798c17b6bb1d64c35d1ca071286419e55266e644 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 5 Sep 2018 10:40:12 +0000 Subject: [PATCH 26/59] Bump rspec-rails from 3.4.2 to 3.8.0 Bumps [rspec-rails](https://github.com/rspec/rspec-rails) from 3.4.2 to 3.8.0. - [Release notes](https://github.com/rspec/rspec-rails/releases) - [Changelog](https://github.com/rspec/rspec-rails/blob/master/Changelog.md) - [Commits](https://github.com/rspec/rspec-rails/compare/v3.4.2...v3.8.0) Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 46 +++++++++++++++++++++++----------------------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Gemfile b/Gemfile index 2feb3541..121457dc 100644 --- a/Gemfile +++ b/Gemfile @@ -31,7 +31,7 @@ gem 'aws-sdk', '~> 2.0' group :development, :test do gem 'byebug' - gem 'rspec-rails', '~> 3.0' + gem 'rspec-rails', '~> 3.8' gem 'guard-rspec', require: false gem 'factory_bot_rails', '~> 4.0' gem 'database_cleaner' diff --git a/Gemfile.lock b/Gemfile.lock index 8931efe1..10dbde61 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -52,13 +52,13 @@ GEM codeclimate-test-reporter (0.5.2) simplecov (>= 0.7.1, < 1.0.0) coderay (1.1.2) - coffee-rails (4.1.1) + coffee-rails (4.2.2) coffee-script (>= 2.2.0) - railties (>= 4.0.0, < 5.1.x) + railties (>= 4.0.0) coffee-script (2.4.1) coffee-script-source execjs - coffee-script-source (1.10.0) + coffee-script-source (1.12.2) concurrent-ruby (1.0.5) crack (0.4.3) safe_yaml (~> 1.0.0) @@ -191,27 +191,27 @@ GEM ffi (>= 0.5.0, < 2) rdoc (6.0.4) ref (2.0.0) - rspec (3.4.0) - rspec-core (~> 3.4.0) - rspec-expectations (~> 3.4.0) - rspec-mocks (~> 3.4.0) - rspec-core (3.4.4) - rspec-support (~> 3.4.0) - rspec-expectations (3.4.0) + rspec (3.8.0) + rspec-core (~> 3.8.0) + rspec-expectations (~> 3.8.0) + rspec-mocks (~> 3.8.0) + rspec-core (3.8.0) + rspec-support (~> 3.8.0) + rspec-expectations (3.8.1) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.4.0) - rspec-mocks (3.4.1) + rspec-support (~> 3.8.0) + rspec-mocks (3.8.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.4.0) - rspec-rails (3.4.2) - actionpack (>= 3.0, < 4.3) - activesupport (>= 3.0, < 4.3) - railties (>= 3.0, < 4.3) - rspec-core (~> 3.4.0) - rspec-expectations (~> 3.4.0) - rspec-mocks (~> 3.4.0) - rspec-support (~> 3.4.0) - rspec-support (3.4.1) + rspec-support (~> 3.8.0) + rspec-rails (3.8.0) + actionpack (>= 3.0) + activesupport (>= 3.0) + railties (>= 3.0) + rspec-core (~> 3.8.0) + rspec-expectations (~> 3.8.0) + rspec-mocks (~> 3.8.0) + rspec-support (~> 3.8.0) + rspec-support (3.8.0) ruby_dep (1.5.0) safe_yaml (1.0.4) sass (3.5.7) @@ -294,7 +294,7 @@ DEPENDENCIES rack-cache rails (~> 4.2) rails_12factor - rspec-rails (~> 3.0) + rspec-rails (~> 3.8) sass-rails (~> 5.0) sdoc (~> 1.0.0) simple_form (~> 3.2) From e0343e891f95ae2ea62fd69b3ae5ceec4ca9767a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 5 Sep 2018 10:40:17 +0000 Subject: [PATCH 27/59] Bump rack-cache from 1.6.1 to 1.8.0 Bumps [rack-cache](https://github.com/rtomayko/rack-cache) from 1.6.1 to 1.8.0. - [Release notes](https://github.com/rtomayko/rack-cache/releases) - [Changelog](https://github.com/rtomayko/rack-cache/blob/master/CHANGES) - [Commits](https://github.com/rtomayko/rack-cache/compare/v1.6.1...v1.8.0) Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 8931efe1..8f05d247 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -150,7 +150,7 @@ GEM public_suffix (3.0.3) puma (3.12.0) rack (1.6.10) - rack-cache (1.6.1) + rack-cache (1.8.0) rack (>= 0.4) rack-protection (1.5.5) rack From 67a99191375e117630af2b9c4780a8db22e39e12 Mon Sep 17 00:00:00 2001 From: Grey Baker Date: Tue, 4 Sep 2018 19:33:24 +0100 Subject: [PATCH 28/59] Update to Rails 5.0.7 --- Gemfile | 3 +- Gemfile.lock | 125 ++++++++++-------- app/controllers/application_controller.rb | 2 +- app/controllers/changes_controller.rb | 2 +- app/models/app_setting.rb | 2 +- app/models/application_record.rb | 3 + app/models/change.rb | 2 +- app/models/page.rb | 2 +- app/models/page_snapshot.rb | 4 +- app/models/slack_integration.rb | 2 +- app/models/sqs_integration.rb | 2 +- app/models/subscription.rb | 2 +- app/models/user.rb | 2 +- config/application.rb | 5 +- config/environments/production.rb | 2 +- config/environments/test.rb | 4 +- spec/controllers/sessions_controller_spec.rb | 4 +- .../slack_integrations_controller_spec.rb | 32 ++--- .../sqs_integrations_controller_spec.rb | 32 ++--- spec/requests/api_controller_spec.rb | 8 +- spec/requests/change_spec.rb | 2 +- 21 files changed, 128 insertions(+), 114 deletions(-) create mode 100644 app/models/application_record.rb diff --git a/Gemfile b/Gemfile index 478b897d..5bfe3be6 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source 'https://rubygems.org' ruby '2.3.4' -gem 'rails', '~> 4.2' +gem 'rails', '5.0.7' gem 'pg', '~> 0.21' gem 'sass-rails', '~> 5.0' gem 'uglifier', '>= 1.3.0' @@ -40,6 +40,7 @@ end group :test do gem 'webmock' + gem 'rails-controller-testing' gem 'codeclimate-test-reporter', require: nil end diff --git a/Gemfile.lock b/Gemfile.lock index 58ad2442..b02b0b1b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,43 +1,46 @@ GEM remote: https://rubygems.org/ specs: - actionmailer (4.2.10) - actionpack (= 4.2.10) - actionview (= 4.2.10) - activejob (= 4.2.10) + actioncable (5.0.7) + actionpack (= 5.0.7) + nio4r (>= 1.2, < 3.0) + websocket-driver (~> 0.6.1) + actionmailer (5.0.7) + actionpack (= 5.0.7) + actionview (= 5.0.7) + activejob (= 5.0.7) mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 1.0, >= 1.0.5) - actionpack (4.2.10) - actionview (= 4.2.10) - activesupport (= 4.2.10) - rack (~> 1.6) - rack-test (~> 0.6.2) - rails-dom-testing (~> 1.0, >= 1.0.5) + rails-dom-testing (~> 2.0) + actionpack (5.0.7) + actionview (= 5.0.7) + activesupport (= 5.0.7) + rack (~> 2.0) + rack-test (~> 0.6.3) + rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (4.2.10) - activesupport (= 4.2.10) + actionview (5.0.7) + activesupport (= 5.0.7) builder (~> 3.1) erubis (~> 2.7.0) - rails-dom-testing (~> 1.0, >= 1.0.5) + rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (4.2.10) - activesupport (= 4.2.10) - globalid (>= 0.3.0) - activemodel (4.2.10) - activesupport (= 4.2.10) - builder (~> 3.1) - activerecord (4.2.10) - activemodel (= 4.2.10) - activesupport (= 4.2.10) - arel (~> 6.0) - activesupport (4.2.10) - i18n (~> 0.7) + activejob (5.0.7) + activesupport (= 5.0.7) + globalid (>= 0.3.6) + activemodel (5.0.7) + activesupport (= 5.0.7) + activerecord (5.0.7) + activemodel (= 5.0.7) + activesupport (= 5.0.7) + arel (~> 7.0) + activesupport (5.0.7) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) addressable (2.5.2) public_suffix (>= 2.0.2, < 4.0) - arel (6.0.4) + arel (7.1.4) aws-sdk (2.6.26) aws-sdk-resources (= 2.6.26) aws-sdk-core (2.6.26) @@ -100,7 +103,7 @@ GEM htmlentities (4.3.4) httparty (0.16.2) multi_xml (>= 0.5.2) - i18n (0.9.5) + i18n (1.1.0) concurrent-ruby (~> 1.0) jmespath (1.3.1) jquery-rails (4.1.1) @@ -130,7 +133,9 @@ GEM mini_portile2 (2.3.0) minitest (5.11.3) multi_xml (0.6.0) + mustermann (1.0.3) nenv (0.3.0) + nio4r (2.3.1) nokogiri (1.8.4) mini_portile2 (~> 2.3.0) notiffany (0.1.1) @@ -149,30 +154,32 @@ GEM method_source (~> 0.9.0) public_suffix (3.0.3) puma (3.12.0) - rack (1.6.10) + rack (2.0.5) rack-cache (1.8.0) rack (>= 0.4) - rack-protection (1.5.5) + rack-protection (2.0.3) rack rack-test (0.6.3) rack (>= 1.0) - rails (4.2.10) - actionmailer (= 4.2.10) - actionpack (= 4.2.10) - actionview (= 4.2.10) - activejob (= 4.2.10) - activemodel (= 4.2.10) - activerecord (= 4.2.10) - activesupport (= 4.2.10) - bundler (>= 1.3.0, < 2.0) - railties (= 4.2.10) - sprockets-rails - rails-deprecated_sanitizer (1.0.3) - activesupport (>= 4.2.0.alpha) - rails-dom-testing (1.0.9) - activesupport (>= 4.2.0, < 5.0) - nokogiri (~> 1.6) - rails-deprecated_sanitizer (>= 1.0.1) + rails (5.0.7) + actioncable (= 5.0.7) + actionmailer (= 5.0.7) + actionpack (= 5.0.7) + actionview (= 5.0.7) + activejob (= 5.0.7) + activemodel (= 5.0.7) + activerecord (= 5.0.7) + activesupport (= 5.0.7) + bundler (>= 1.3.0) + railties (= 5.0.7) + sprockets-rails (>= 2.0.0) + rails-controller-testing (1.0.2) + actionpack (~> 5.x, >= 5.0.1) + actionview (~> 5.x, >= 5.0.1) + activesupport (~> 5.x) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) rails-html-sanitizer (1.0.4) loofah (~> 2.2, >= 2.2.2) rails_12factor (0.0.3) @@ -180,9 +187,10 @@ GEM rails_stdout_logging rails_serve_static_assets (0.0.5) rails_stdout_logging (0.0.5) - railties (4.2.10) - actionpack (= 4.2.10) - activesupport (= 4.2.10) + railties (5.0.7) + actionpack (= 5.0.7) + activesupport (= 5.0.7) + method_source rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) rake (12.3.1) @@ -236,10 +244,11 @@ GEM json (~> 1.8) simplecov-html (~> 0.10.0) simplecov-html (0.10.0) - sinatra (1.4.8) - rack (~> 1.5) - rack-protection (~> 1.4) - tilt (>= 1.3, < 3) + sinatra (2.0.3) + mustermann (~> 1.0) + rack (~> 2.0) + rack-protection (= 2.0.3) + tilt (~> 2.0) spring (2.0.2) activesupport (>= 4.2) sprockets (3.7.2) @@ -269,6 +278,9 @@ GEM addressable (>= 2.3.6) crack (>= 0.3.2) hashdiff + websocket-driver (0.6.5) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.3) PLATFORMS ruby @@ -292,7 +304,8 @@ DEPENDENCIES premailer-rails puma (~> 3.12) rack-cache - rails (~> 4.2) + rails (= 5.0.7) + rails-controller-testing rails_12factor rspec-rails (~> 3.8) sass-rails (~> 5.0) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 50ad6bd6..2653d320 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -8,7 +8,7 @@ def authorize end end - before_filter :set_default_host + before_action :set_default_host def set_default_host # determine the host we're running on, so we can generate urls for emails, etc # keep this in an AppSetting (persisted) and pass to Rails when blank diff --git a/app/controllers/changes_controller.rb b/app/controllers/changes_controller.rb index 342bb916..8d980267 100644 --- a/app/controllers/changes_controller.rb +++ b/app/controllers/changes_controller.rb @@ -1,5 +1,5 @@ class ChangesController < ApplicationController - before_filter :set_change, only: [:page, :update, :resend] + before_action :set_change, only: [:page, :update, :resend] before_action :authorize def page diff --git a/app/models/app_setting.rb b/app/models/app_setting.rb index 74455270..07ff1d2c 100644 --- a/app/models/app_setting.rb +++ b/app/models/app_setting.rb @@ -1,4 +1,4 @@ -class AppSetting < ActiveRecord::Base +class AppSetting < ApplicationRecord def self.default_host_key 'default_host' diff --git a/app/models/application_record.rb b/app/models/application_record.rb new file mode 100644 index 00000000..10a4cba8 --- /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/change.rb b/app/models/change.rb index 2b46bf3b..9953f49c 100644 --- a/app/models/change.rb +++ b/app/models/change.rb @@ -1,4 +1,4 @@ -class Change < ActiveRecord::Base +class Change < ApplicationRecord belongs_to :before, polymorphic: true validates :before, presence: true diff --git a/app/models/page.rb b/app/models/page.rb index 6a81c1ad..204cca51 100644 --- a/app/models/page.rb +++ b/app/models/page.rb @@ -1,4 +1,4 @@ -class Page < ActiveRecord::Base +class Page < ApplicationRecord belongs_to :user has_many :page_snapshots, dependent: :destroy diff --git a/app/models/page_snapshot.rb b/app/models/page_snapshot.rb index b17aaa3a..aab0ac5a 100644 --- a/app/models/page_snapshot.rb +++ b/app/models/page_snapshot.rb @@ -1,6 +1,6 @@ -class PageSnapshot < ActiveRecord::Base +class PageSnapshot < ApplicationRecord belongs_to :page - validates :page, presence: true + validates :sha2_hash, presence: true after_destroy do |record| diff --git a/app/models/slack_integration.rb b/app/models/slack_integration.rb index e4cf74b4..9c999ab4 100644 --- a/app/models/slack_integration.rb +++ b/app/models/slack_integration.rb @@ -1,4 +1,4 @@ -class SlackIntegration < ActiveRecord::Base +class SlackIntegration < ApplicationRecord validates :channel, length: { minimum: 2 } validates :webhook_url, length: { minimum: 10 } diff --git a/app/models/sqs_integration.rb b/app/models/sqs_integration.rb index 931ca3fe..18084dde 100644 --- a/app/models/sqs_integration.rb +++ b/app/models/sqs_integration.rb @@ -1,4 +1,4 @@ -class SqsIntegration < ActiveRecord::Base +class SqsIntegration < ApplicationRecord validates :queue_url, length: { minimum: 10 } validate :starts_with_https diff --git a/app/models/subscription.rb b/app/models/subscription.rb index 78e3c5aa..ea9de394 100644 --- a/app/models/subscription.rb +++ b/app/models/subscription.rb @@ -1,4 +1,4 @@ -class Subscription < ActiveRecord::Base +class Subscription < ApplicationRecord belongs_to :watcher, polymorphic: true validates :watcher, presence: true diff --git a/app/models/user.rb b/app/models/user.rb index a4514df2..323044a6 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,4 +1,4 @@ -class User < ActiveRecord::Base +class User < ApplicationRecord validates :email, length: { minimum: 3 }, uniqueness: { case_sensitive: false } validate :email_domain_is_approved, on: [ :create, :update ] has_many :pages diff --git a/config/application.rb b/config/application.rb index 4519b6c4..d3c8b83b 100644 --- a/config/application.rb +++ b/config/application.rb @@ -35,10 +35,7 @@ class Application < Rails::Application config.autoload_paths << "#{Rails.root}/lib" - # Do not swallow errors in after_commit/after_rollback callbacks. - config.active_record.raise_in_transactional_callbacks = true - - config.static_cache_control = "public, max-age=31536000" + config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=31536000' } config.middleware.use Rack::Cache, verbose: true, diff --git a/config/environments/production.rb b/config/environments/production.rb index f6922e0f..fc028a47 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -22,7 +22,7 @@ # Disable serving static files from the `/public` folder by default since # Apache or NGINX already handles this. - config.serve_static_files = true + config.public_file_server.enabled = true # Compress JavaScripts and CSS. config.assets.js_compressor = :uglifier diff --git a/config/environments/test.rb b/config/environments/test.rb index 1c19f08b..740d1383 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -13,8 +13,8 @@ config.eager_load = false # Configure static file server for tests with Cache-Control for performance. - config.serve_static_files = true - config.static_cache_control = 'public, max-age=3600' + 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 diff --git a/spec/controllers/sessions_controller_spec.rb b/spec/controllers/sessions_controller_spec.rb index 46f8eaed..be4e21bb 100644 --- a/spec/controllers/sessions_controller_spec.rb +++ b/spec/controllers/sessions_controller_spec.rb @@ -12,13 +12,13 @@ describe "POST #create" do it "accepts an email for login" do user = create(:user) - post :create, email: user.email + post :create, params: { email: user.email } expect(response).not_to redirect_to(unknown_user_path) end it "is case-insensitive when checking emails" do user = create(:user) - post :create, email: user.email.upcase + post :create, params: { email: user.email.upcase } expect(response).not_to redirect_to(unknown_user_path) end end diff --git a/spec/controllers/slack_integrations_controller_spec.rb b/spec/controllers/slack_integrations_controller_spec.rb index 641c14d1..b9400990 100644 --- a/spec/controllers/slack_integrations_controller_spec.rb +++ b/spec/controllers/slack_integrations_controller_spec.rb @@ -39,7 +39,7 @@ describe "GET #index" do it "assigns all slack_integrations as @slack_integrations" do slack_integration = SlackIntegration.create! valid_attributes - get :index, {}, valid_session + get :index, params: {}, headers: valid_session expect(assigns(:slack_integrations)).to eq([slack_integration]) end end @@ -47,14 +47,14 @@ describe "GET #show" do it "assigns the requested slack_integration as @slack_integration" do slack_integration = SlackIntegration.create! valid_attributes - get :show, {:id => slack_integration.to_param}, valid_session + get :show, params: {:id => slack_integration.to_param}, headers: valid_session expect(assigns(:slack_integration)).to eq(slack_integration) end end describe "GET #new" do it "assigns a new slack_integration as @slack_integration" do - get :new, {}, valid_session + get :new, params: {}, headers: valid_session expect(assigns(:slack_integration)).to be_a_new(SlackIntegration) end end @@ -62,7 +62,7 @@ describe "GET #edit" do it "assigns the requested slack_integration as @slack_integration" do slack_integration = SlackIntegration.create! valid_attributes - get :edit, {:id => slack_integration.to_param}, valid_session + get :edit, params: {:id => slack_integration.to_param}, headers: valid_session expect(assigns(:slack_integration)).to eq(slack_integration) end end @@ -71,30 +71,30 @@ context "with valid params" do it "creates a new SlackIntegration" do expect { - post :create, {:slack_integration => valid_attributes}, valid_session + post :create, params: {:slack_integration => valid_attributes}, headers: valid_session }.to change(SlackIntegration, :count).by(1) end it "assigns a newly created slack_integration as @slack_integration" do - post :create, {:slack_integration => valid_attributes}, valid_session + post :create, params: {:slack_integration => valid_attributes}, headers: valid_session expect(assigns(:slack_integration)).to be_a(SlackIntegration) expect(assigns(:slack_integration)).to be_persisted end it "redirects to the created slack_integration" do - post :create, {:slack_integration => valid_attributes}, valid_session + post :create, params: {:slack_integration => valid_attributes}, headers: valid_session expect(response).to redirect_to(SlackIntegration.last) end end context "with invalid params" do it "assigns a newly created but unsaved slack_integration as @slack_integration" do - post :create, {:slack_integration => invalid_attributes}, valid_session + post :create, params: {:slack_integration => invalid_attributes}, headers: valid_session expect(assigns(:slack_integration)).to be_a_new(SlackIntegration) end it "re-renders the 'new' template" do - post :create, {:slack_integration => invalid_attributes}, valid_session + post :create, params: {:slack_integration => invalid_attributes}, headers: valid_session expect(response).to render_template("new") end end @@ -108,20 +108,20 @@ it "updates the requested slack_integration" do slack_integration = SlackIntegration.create! valid_attributes - put :update, {:id => slack_integration.to_param, :slack_integration => new_attributes}, valid_session + put :update, params: {:id => slack_integration.to_param, :slack_integration => new_attributes}, headers: valid_session slack_integration.reload skip("Add assertions for updated state") end it "assigns the requested slack_integration as @slack_integration" do slack_integration = SlackIntegration.create! valid_attributes - put :update, {:id => slack_integration.to_param, :slack_integration => valid_attributes}, valid_session + put :update, params: {:id => slack_integration.to_param, :slack_integration => valid_attributes}, headers: valid_session expect(assigns(:slack_integration)).to eq(slack_integration) end it "redirects to the slack_integration" do slack_integration = SlackIntegration.create! valid_attributes - put :update, {:id => slack_integration.to_param, :slack_integration => valid_attributes}, valid_session + put :update, params: {:id => slack_integration.to_param, :slack_integration => valid_attributes}, headers: valid_session expect(response).to redirect_to(slack_integration) end end @@ -129,13 +129,13 @@ context "with invalid params" do it "assigns the slack_integration as @slack_integration" do slack_integration = SlackIntegration.create! valid_attributes - put :update, {:id => slack_integration.to_param, :slack_integration => invalid_attributes}, valid_session + put :update, params: {:id => slack_integration.to_param, :slack_integration => invalid_attributes}, headers: valid_session expect(assigns(:slack_integration)).to eq(slack_integration) end it "re-renders the 'edit' template" do slack_integration = SlackIntegration.create! valid_attributes - put :update, {:id => slack_integration.to_param, :slack_integration => invalid_attributes}, valid_session + put :update, params: {:id => slack_integration.to_param, :slack_integration => invalid_attributes}, headers: valid_session expect(response).to render_template("edit") end end @@ -145,13 +145,13 @@ it "destroys the requested slack_integration" do slack_integration = SlackIntegration.create! valid_attributes expect { - delete :destroy, {:id => slack_integration.to_param}, valid_session + delete :destroy, params: {:id => slack_integration.to_param}, headers: valid_session }.to change(SlackIntegration, :count).by(-1) end it "redirects to the slack_integrations list" do slack_integration = SlackIntegration.create! valid_attributes - delete :destroy, {:id => slack_integration.to_param}, valid_session + delete :destroy, params: {:id => slack_integration.to_param}, headers: valid_session expect(response).to redirect_to(slack_integrations_url) end end diff --git a/spec/controllers/sqs_integrations_controller_spec.rb b/spec/controllers/sqs_integrations_controller_spec.rb index 6eb3963e..681e8b58 100644 --- a/spec/controllers/sqs_integrations_controller_spec.rb +++ b/spec/controllers/sqs_integrations_controller_spec.rb @@ -43,7 +43,7 @@ describe "GET #index" do it "assigns all sqs_integrations as @sqs_integrations" do sqs_integration = SqsIntegration.create! valid_attributes - get :index, {}, valid_session + get :index, params: {}, headers: valid_session expect(assigns(:sqs_integrations)).to eq([sqs_integration]) end end @@ -51,14 +51,14 @@ describe "GET #show" do it "assigns the requested sqs_integration as @sqs_integration" do sqs_integration = SqsIntegration.create! valid_attributes - get :show, {:id => sqs_integration.to_param}, valid_session + get :show, params: {:id => sqs_integration.to_param}, headers: valid_session expect(assigns(:sqs_integration)).to eq(sqs_integration) end end describe "GET #new" do it "assigns a new sqs_integration as @sqs_integration" do - get :new, {}, valid_session + get :new, params: {}, headers: valid_session expect(assigns(:sqs_integration)).to be_a_new(SqsIntegration) end end @@ -66,7 +66,7 @@ describe "GET #edit" do it "assigns the requested sqs_integration as @sqs_integration" do sqs_integration = SqsIntegration.create! valid_attributes - get :edit, {:id => sqs_integration.to_param}, valid_session + get :edit, params: {:id => sqs_integration.to_param}, headers: valid_session expect(assigns(:sqs_integration)).to eq(sqs_integration) end end @@ -75,30 +75,30 @@ context "with valid params" do it "creates a new SqsIntegration" do expect { - post :create, {:sqs_integration => valid_attributes}, valid_session + post :create, params: {:sqs_integration => valid_attributes}, headers: valid_session }.to change(SqsIntegration, :count).by(1) end it "assigns a newly created sqs_integration as @sqs_integration" do - post :create, {:sqs_integration => valid_attributes}, valid_session + post :create, params: {:sqs_integration => valid_attributes}, headers: valid_session expect(assigns(:sqs_integration)).to be_a(SqsIntegration) expect(assigns(:sqs_integration)).to be_persisted end it "redirects to the intersections path" do - post :create, {:sqs_integration => valid_attributes}, valid_session + post :create, params: {:sqs_integration => valid_attributes}, headers: valid_session expect(response).to redirect_to(integrations_path) end end context "with invalid params" do it "assigns a newly created but unsaved sqs_integration as @sqs_integration" do - post :create, {:sqs_integration => invalid_attributes}, valid_session + post :create, params: {:sqs_integration => invalid_attributes}, headers: valid_session expect(assigns(:sqs_integration)).to be_a_new(SqsIntegration) end it "re-renders the 'new' template" do - post :create, {:sqs_integration => invalid_attributes}, valid_session + post :create, params: {:sqs_integration => invalid_attributes}, headers: valid_session expect(response).to render_template("new") end end @@ -114,7 +114,7 @@ it "updates the requested sqs_integration" do sqs_integration = SqsIntegration.create! valid_attributes - put :update, {:id => sqs_integration.to_param, :sqs_integration => new_attributes}, valid_session + put :update, params: {:id => sqs_integration.to_param, :sqs_integration => new_attributes}, headers: valid_session sqs_integration.reload expect(sqs_integration.queue_url).to eq(new_attributes[:queue_url]) expect(sqs_integration).to be_persisted @@ -122,13 +122,13 @@ it "assigns the requested sqs_integration as @sqs_integration" do sqs_integration = SqsIntegration.create! valid_attributes - put :update, {:id => sqs_integration.to_param, :sqs_integration => valid_attributes}, valid_session + put :update, params: {:id => sqs_integration.to_param, :sqs_integration => valid_attributes}, headers: valid_session expect(assigns(:sqs_integration)).to eq(sqs_integration) end it "redirects to the sqs_integration" do sqs_integration = SqsIntegration.create! valid_attributes - put :update, {:id => sqs_integration.to_param, :sqs_integration => valid_attributes}, valid_session + put :update, params: {:id => sqs_integration.to_param, :sqs_integration => valid_attributes}, headers: valid_session expect(response).to redirect_to(integrations_path) end end @@ -136,13 +136,13 @@ context "with invalid params" do it "assigns the sqs_integration as @sqs_integration" do sqs_integration = SqsIntegration.create! valid_attributes - put :update, {:id => sqs_integration.to_param, :sqs_integration => invalid_attributes}, valid_session + put :update, params: {:id => sqs_integration.to_param, :sqs_integration => invalid_attributes}, headers: valid_session expect(assigns(:sqs_integration)).to eq(sqs_integration) end it "re-renders the 'edit' template" do sqs_integration = SqsIntegration.create! valid_attributes - put :update, {:id => sqs_integration.to_param, :sqs_integration => invalid_attributes}, valid_session + put :update, params: {:id => sqs_integration.to_param, :sqs_integration => invalid_attributes}, headers: valid_session expect(response).to render_template("edit") end end @@ -152,13 +152,13 @@ it "destroys the requested sqs_integration" do sqs_integration = SqsIntegration.create! valid_attributes expect { - delete :destroy, {:id => sqs_integration.to_param}, valid_session + delete :destroy, params: {:id => sqs_integration.to_param}, headers: valid_session }.to change(SqsIntegration, :count).by(-1) end it "redirects to the sqs_integrations list" do sqs_integration = SqsIntegration.create! valid_attributes - delete :destroy, {:id => sqs_integration.to_param}, valid_session + delete :destroy, params: {:id => sqs_integration.to_param}, headers: valid_session expect(response).to redirect_to(integrations_path) end end diff --git a/spec/requests/api_controller_spec.rb b/spec/requests/api_controller_spec.rb index e365d616..bf579df8 100644 --- a/spec/requests/api_controller_spec.rb +++ b/spec/requests/api_controller_spec.rb @@ -7,7 +7,7 @@ # login @user = User.where(email: 'test@test.com').first_or_create - get(token_session_path, token: LoginToken.create(user: @user)) + get(token_session_path, params: { token: LoginToken.create(user: @user) }) end describe "/page-preview" do @@ -16,7 +16,7 @@ url = 'https://www.themarshallproject.org' css_selector = 'header' - get(api_page_preview_path, url: url, css_selector: css_selector) + get(api_page_preview_path, params: { url: url, css_selector: css_selector }) expect(response).to have_http_status(:success) @@ -37,7 +37,7 @@ selector = ".first-column-region .story" # create the page - post(embed_find_page_path, url: url) + post(embed_find_page_path, params: { url: url }) expect(response).to have_http_status(:success) data = JSON.parse(response.body) expect(data['url']).to eq url @@ -46,7 +46,7 @@ expect(page.user).to eq @user # update the page - post(embed_update_page_selector_path, id: page.id, css_selector: selector) + post(embed_update_page_selector_path, params: { id: page.id, css_selector: selector }) data = JSON.parse(response.body) expect(data['css_selector']).to eq selector expect(data['user_id']).to eq @user.id diff --git a/spec/requests/change_spec.rb b/spec/requests/change_spec.rb index 182a4f5d..3539ca7d 100644 --- a/spec/requests/change_spec.rb +++ b/spec/requests/change_spec.rb @@ -8,7 +8,7 @@ # login @user = User.where(email: 'test@test.com').first_or_create - get(token_session_path, token: LoginToken.create(user: @user)) + get(token_session_path, params: { token: LoginToken.create(user: @user) }) end it "can create multiple snapshots and send an email based on the last pair" do From e7b6c7b0e670c86c9f3f1db3533372d0faea05a6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 5 Sep 2018 14:25:05 +0000 Subject: [PATCH 29/59] Bump kramdown from 1.11.1 to 1.17.0 Bumps [kramdown](https://github.com/gettalong/kramdown) from 1.11.1 to 1.17.0. - [Release notes](https://github.com/gettalong/kramdown/releases) - [Changelog](https://github.com/gettalong/kramdown/blob/master/doc/news.page) - [Commits](https://github.com/gettalong/kramdown/commits) Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 58ad2442..cec10fc5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -109,7 +109,7 @@ GEM thor (>= 0.14, < 2.0) json (1.8.6) jwt (2.1.0) - kramdown (1.11.1) + kramdown (1.17.0) launchy (2.4.3) addressable (~> 2.3) letter_opener (1.4.1) From 55c758d3e27b3cb914e95bb544934ee3667953c0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 5 Sep 2018 15:37:51 +0000 Subject: [PATCH 30/59] Bump web-console from 3.3.0 to 3.7.0 Bumps [web-console](https://github.com/rails/web-console) from 3.3.0 to 3.7.0. - [Release notes](https://github.com/rails/web-console/releases) - [Changelog](https://github.com/rails/web-console/blob/master/CHANGELOG.markdown) - [Commits](https://github.com/rails/web-console/compare/v3.3.0...v3.7.0) Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Gemfile b/Gemfile index 5bfe3be6..b4b53a7e 100644 --- a/Gemfile +++ b/Gemfile @@ -46,6 +46,6 @@ end group :development do gem 'letter_opener' - gem 'web-console', '~> 3.3' + gem 'web-console', '~> 3.7' gem 'spring' end diff --git a/Gemfile.lock b/Gemfile.lock index 894c2cf9..16afaab4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -50,6 +50,7 @@ GEM aws-sdk-core (= 2.6.26) aws-sigv4 (1.0.0) bcrypt (3.1.12) + bindex (0.5.0) builder (3.2.3) byebug (9.0.5) codeclimate-test-reporter (0.5.2) @@ -69,7 +70,6 @@ GEM css_parser (1.6.0) addressable database_cleaner (1.7.0) - debug_inspector (0.0.3) diff-lcs (1.3) diffy (3.2.1) docile (1.1.5) @@ -270,10 +270,11 @@ GEM thread_safe (~> 0.1) uglifier (4.1.18) execjs (>= 0.3.0, < 3) - web-console (3.3.0) - activemodel (>= 4.2) - debug_inspector - railties (>= 4.2) + web-console (3.7.0) + actionview (>= 5.0) + activemodel (>= 5.0) + bindex (>= 0.4.0) + railties (>= 5.0) webmock (3.4.2) addressable (>= 2.3.6) crack (>= 0.3.2) @@ -316,7 +317,7 @@ DEPENDENCIES therubyracer turbolinks uglifier (>= 1.3.0) - web-console (~> 3.3) + web-console (~> 3.7) webmock RUBY VERSION From 9fa7de669f98176b7201493dffda61d0cd550d4f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Thu, 6 Sep 2018 10:31:45 +0000 Subject: [PATCH 31/59] Bump jquery-rails from 4.1.1 to 4.3.3 Bumps [jquery-rails](https://github.com/rails/jquery-rails) from 4.1.1 to 4.3.3. - [Release notes](https://github.com/rails/jquery-rails/releases) - [Changelog](https://github.com/rails/jquery-rails/blob/master/CHANGELOG.md) - [Commits](https://github.com/rails/jquery-rails/compare/v4.1.1...v4.3.3) Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 16afaab4..79c91f32 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -106,7 +106,7 @@ GEM i18n (1.1.0) concurrent-ruby (~> 1.0) jmespath (1.3.1) - jquery-rails (4.1.1) + jquery-rails (4.3.3) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) From 1a31466612121f2aeb44fdac0ebb163cc9bb5cb9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Thu, 6 Sep 2018 10:32:18 +0000 Subject: [PATCH 32/59] Bump letter_opener from 1.4.1 to 1.6.0 Bumps [letter_opener](https://github.com/ryanb/letter_opener) from 1.4.1 to 1.6.0. - [Release notes](https://github.com/ryanb/letter_opener/releases) - [Changelog](https://github.com/ryanb/letter_opener/blob/master/CHANGELOG.md) - [Commits](https://github.com/ryanb/letter_opener/compare/v1.4.1...v1.6.0) Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 16afaab4..88d7c506 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -115,7 +115,7 @@ GEM kramdown (1.17.0) launchy (2.4.3) addressable (~> 2.3) - letter_opener (1.4.1) + letter_opener (1.6.0) launchy (~> 2.2) libv8 (3.16.14.19) listen (3.1.5) From accc3d5028413bb87053936ef02ef3ea59090149 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Thu, 6 Sep 2018 10:32:47 +0000 Subject: [PATCH 33/59] Bump byebug from 9.0.5 to 10.0.2 Bumps [byebug](https://github.com/deivid-rodriguez/byebug) from 9.0.5 to 10.0.2. - [Release notes](https://github.com/deivid-rodriguez/byebug/releases) - [Changelog](https://github.com/deivid-rodriguez/byebug/blob/master/CHANGELOG.md) - [Commits](https://github.com/deivid-rodriguez/byebug/compare/v9.0.5...v10.0.2) Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 16afaab4..7c84a2d4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -52,7 +52,7 @@ GEM bcrypt (3.1.12) bindex (0.5.0) builder (3.2.3) - byebug (9.0.5) + byebug (10.0.2) codeclimate-test-reporter (0.5.2) simplecov (>= 0.7.1, < 1.0.0) coderay (1.1.2) From 34f76921e785a9e6d1df4a56f0db79ed0bee3d3d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Thu, 6 Sep 2018 10:33:16 +0000 Subject: [PATCH 34/59] Bump simple_form from 3.2.1 to 4.0.1 Bumps [simple_form](https://github.com/plataformatec/simple_form) from 3.2.1 to 4.0.1. - [Release notes](https://github.com/plataformatec/simple_form/releases) - [Changelog](https://github.com/plataformatec/simple_form/blob/master/CHANGELOG.md) - [Commits](https://github.com/plataformatec/simple_form/compare/v3.2.1...v4.0.1) Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index b4b53a7e..68908b76 100644 --- a/Gemfile +++ b/Gemfile @@ -17,7 +17,7 @@ gem 'bcrypt', '~> 3.1.12' gem 'puma', '~> 3.12' gem 'rails_12factor' -gem 'simple_form', '~> 3.2' +gem 'simple_form', '~> 4.0' gem 'jwt' gem 'premailer-rails' diff --git a/Gemfile.lock b/Gemfile.lock index 16afaab4..6706f1d9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -236,9 +236,9 @@ GEM sdoc (1.0.0) rdoc (>= 5.0) shellany (0.0.1) - simple_form (3.2.1) - actionpack (> 4, < 5.1) - activemodel (> 4, < 5.1) + simple_form (4.0.1) + actionpack (>= 5.0) + activemodel (>= 5.0) simplecov (0.11.2) docile (~> 1.1.0) json (~> 1.8) @@ -311,7 +311,7 @@ DEPENDENCIES rspec-rails (~> 3.8) sass-rails (~> 5.0) sdoc (~> 1.0.0) - simple_form (~> 3.2) + simple_form (~> 4.0) sinatra spring therubyracer From 097bb34599dd65905a9ee40ea894f35516237aa2 Mon Sep 17 00:00:00 2001 From: Grey Baker Date: Thu, 6 Sep 2018 14:30:30 +0100 Subject: [PATCH 35/59] Upgrade to Rails 5.1.6 --- Gemfile | 3 +- Gemfile.lock | 94 ++++++++++--------- .../slack_integrations_controller_spec.rb | 37 ++++---- .../sqs_integrations_controller_spec.rb | 37 ++++---- 4 files changed, 82 insertions(+), 89 deletions(-) diff --git a/Gemfile b/Gemfile index b4b53a7e..69607b59 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source 'https://rubygems.org' ruby '2.3.4' -gem 'rails', '5.0.7' +gem 'rails', '~> 5.1.6' gem 'pg', '~> 0.21' gem 'sass-rails', '~> 5.0' gem 'uglifier', '>= 1.3.0' @@ -10,6 +10,7 @@ gem 'therubyracer' gem 'dotenv' gem 'jquery-rails' gem 'turbolinks' +gem 'coffee-rails' gem 'sdoc', '~> 1.0.0', group: :doc gem 'rack-cache' diff --git a/Gemfile.lock b/Gemfile.lock index 16afaab4..2603ba87 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,46 +1,46 @@ GEM remote: https://rubygems.org/ specs: - actioncable (5.0.7) - actionpack (= 5.0.7) - nio4r (>= 1.2, < 3.0) + actioncable (5.1.6) + actionpack (= 5.1.6) + nio4r (~> 2.0) websocket-driver (~> 0.6.1) - actionmailer (5.0.7) - actionpack (= 5.0.7) - actionview (= 5.0.7) - activejob (= 5.0.7) + actionmailer (5.1.6) + actionpack (= 5.1.6) + actionview (= 5.1.6) + activejob (= 5.1.6) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (5.0.7) - actionview (= 5.0.7) - activesupport (= 5.0.7) + actionpack (5.1.6) + actionview (= 5.1.6) + activesupport (= 5.1.6) rack (~> 2.0) - rack-test (~> 0.6.3) + rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.0.7) - activesupport (= 5.0.7) + actionview (5.1.6) + activesupport (= 5.1.6) builder (~> 3.1) - erubis (~> 2.7.0) + erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (5.0.7) - activesupport (= 5.0.7) + activejob (5.1.6) + activesupport (= 5.1.6) globalid (>= 0.3.6) - activemodel (5.0.7) - activesupport (= 5.0.7) - activerecord (5.0.7) - activemodel (= 5.0.7) - activesupport (= 5.0.7) - arel (~> 7.0) - activesupport (5.0.7) + activemodel (5.1.6) + activesupport (= 5.1.6) + activerecord (5.1.6) + activemodel (= 5.1.6) + activesupport (= 5.1.6) + arel (~> 8.0) + activesupport (5.1.6) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) addressable (2.5.2) public_suffix (>= 2.0.2, < 4.0) - arel (7.1.4) + arel (8.0.0) aws-sdk (2.6.26) aws-sdk-resources (= 2.6.26) aws-sdk-core (2.6.26) @@ -74,7 +74,7 @@ GEM diffy (3.2.1) docile (1.1.5) dotenv (2.5.0) - erubis (2.7.0) + erubi (1.7.1) execjs (2.7.0) factory_bot (4.11.0) activesupport (>= 3.0.0) @@ -159,19 +159,19 @@ GEM rack (>= 0.4) rack-protection (2.0.3) rack - rack-test (0.6.3) - rack (>= 1.0) - rails (5.0.7) - actioncable (= 5.0.7) - actionmailer (= 5.0.7) - actionpack (= 5.0.7) - actionview (= 5.0.7) - activejob (= 5.0.7) - activemodel (= 5.0.7) - activerecord (= 5.0.7) - activesupport (= 5.0.7) + rack-test (1.1.0) + rack (>= 1.0, < 3) + rails (5.1.6) + actioncable (= 5.1.6) + actionmailer (= 5.1.6) + actionpack (= 5.1.6) + actionview (= 5.1.6) + activejob (= 5.1.6) + activemodel (= 5.1.6) + activerecord (= 5.1.6) + activesupport (= 5.1.6) bundler (>= 1.3.0) - railties (= 5.0.7) + railties (= 5.1.6) sprockets-rails (>= 2.0.0) rails-controller-testing (1.0.2) actionpack (~> 5.x, >= 5.0.1) @@ -187,9 +187,9 @@ GEM rails_stdout_logging rails_serve_static_assets (0.0.5) rails_stdout_logging (0.0.5) - railties (5.0.7) - actionpack (= 5.0.7) - activesupport (= 5.0.7) + railties (5.1.6) + actionpack (= 5.1.6) + activesupport (= 5.1.6) method_source rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) @@ -236,9 +236,9 @@ GEM sdoc (1.0.0) rdoc (>= 5.0) shellany (0.0.1) - simple_form (3.2.1) - actionpack (> 4, < 5.1) - activemodel (> 4, < 5.1) + simple_form (3.5.1) + actionpack (> 4, < 5.2) + activemodel (> 4, < 5.2) simplecov (0.11.2) docile (~> 1.1.0) json (~> 1.8) @@ -264,8 +264,9 @@ GEM thor (0.20.0) thread_safe (0.3.6) tilt (2.0.8) - turbolinks (2.5.3) - coffee-rails + turbolinks (5.2.0) + turbolinks-source (~> 5.2) + turbolinks-source (5.2.0) tzinfo (1.2.5) thread_safe (~> 0.1) uglifier (4.1.18) @@ -291,6 +292,7 @@ DEPENDENCIES bcrypt (~> 3.1.12) byebug codeclimate-test-reporter + coffee-rails database_cleaner diffy dotenv @@ -305,7 +307,7 @@ DEPENDENCIES premailer-rails puma (~> 3.12) rack-cache - rails (= 5.0.7) + rails (~> 5.1.6) rails-controller-testing rails_12factor rspec-rails (~> 3.8) diff --git a/spec/controllers/slack_integrations_controller_spec.rb b/spec/controllers/slack_integrations_controller_spec.rb index b9400990..6b8d4503 100644 --- a/spec/controllers/slack_integrations_controller_spec.rb +++ b/spec/controllers/slack_integrations_controller_spec.rb @@ -31,15 +31,10 @@ skip("Add a hash of attributes invalid for your model") } - # This should return the minimal set of values that should be in the session - # in order to pass any filters (e.g. authentication) defined in - # SlackIntegrationsController. Be sure to keep this updated too. - let(:valid_session) { {} } - describe "GET #index" do it "assigns all slack_integrations as @slack_integrations" do slack_integration = SlackIntegration.create! valid_attributes - get :index, params: {}, headers: valid_session + get :index, params: {} expect(assigns(:slack_integrations)).to eq([slack_integration]) end end @@ -47,14 +42,14 @@ describe "GET #show" do it "assigns the requested slack_integration as @slack_integration" do slack_integration = SlackIntegration.create! valid_attributes - get :show, params: {:id => slack_integration.to_param}, headers: valid_session + get :show, params: {:id => slack_integration.to_param} expect(assigns(:slack_integration)).to eq(slack_integration) end end describe "GET #new" do it "assigns a new slack_integration as @slack_integration" do - get :new, params: {}, headers: valid_session + get :new, params: {} expect(assigns(:slack_integration)).to be_a_new(SlackIntegration) end end @@ -62,7 +57,7 @@ describe "GET #edit" do it "assigns the requested slack_integration as @slack_integration" do slack_integration = SlackIntegration.create! valid_attributes - get :edit, params: {:id => slack_integration.to_param}, headers: valid_session + get :edit, params: {:id => slack_integration.to_param} expect(assigns(:slack_integration)).to eq(slack_integration) end end @@ -71,30 +66,30 @@ context "with valid params" do it "creates a new SlackIntegration" do expect { - post :create, params: {:slack_integration => valid_attributes}, headers: valid_session + post :create, params: {:slack_integration => valid_attributes} }.to change(SlackIntegration, :count).by(1) end it "assigns a newly created slack_integration as @slack_integration" do - post :create, params: {:slack_integration => valid_attributes}, headers: valid_session + post :create, params: {:slack_integration => valid_attributes} expect(assigns(:slack_integration)).to be_a(SlackIntegration) expect(assigns(:slack_integration)).to be_persisted end it "redirects to the created slack_integration" do - post :create, params: {:slack_integration => valid_attributes}, headers: valid_session + post :create, params: {:slack_integration => valid_attributes} expect(response).to redirect_to(SlackIntegration.last) end end context "with invalid params" do it "assigns a newly created but unsaved slack_integration as @slack_integration" do - post :create, params: {:slack_integration => invalid_attributes}, headers: valid_session + post :create, params: {:slack_integration => invalid_attributes} expect(assigns(:slack_integration)).to be_a_new(SlackIntegration) end it "re-renders the 'new' template" do - post :create, params: {:slack_integration => invalid_attributes}, headers: valid_session + post :create, params: {:slack_integration => invalid_attributes} expect(response).to render_template("new") end end @@ -108,20 +103,20 @@ it "updates the requested slack_integration" do slack_integration = SlackIntegration.create! valid_attributes - put :update, params: {:id => slack_integration.to_param, :slack_integration => new_attributes}, headers: valid_session + put :update, params: {:id => slack_integration.to_param, :slack_integration => new_attributes} slack_integration.reload skip("Add assertions for updated state") end it "assigns the requested slack_integration as @slack_integration" do slack_integration = SlackIntegration.create! valid_attributes - put :update, params: {:id => slack_integration.to_param, :slack_integration => valid_attributes}, headers: valid_session + put :update, params: {:id => slack_integration.to_param, :slack_integration => valid_attributes} expect(assigns(:slack_integration)).to eq(slack_integration) end it "redirects to the slack_integration" do slack_integration = SlackIntegration.create! valid_attributes - put :update, params: {:id => slack_integration.to_param, :slack_integration => valid_attributes}, headers: valid_session + put :update, params: {:id => slack_integration.to_param, :slack_integration => valid_attributes} expect(response).to redirect_to(slack_integration) end end @@ -129,13 +124,13 @@ context "with invalid params" do it "assigns the slack_integration as @slack_integration" do slack_integration = SlackIntegration.create! valid_attributes - put :update, params: {:id => slack_integration.to_param, :slack_integration => invalid_attributes}, headers: valid_session + put :update, params: {:id => slack_integration.to_param, :slack_integration => invalid_attributes} expect(assigns(:slack_integration)).to eq(slack_integration) end it "re-renders the 'edit' template" do slack_integration = SlackIntegration.create! valid_attributes - put :update, params: {:id => slack_integration.to_param, :slack_integration => invalid_attributes}, headers: valid_session + put :update, params: {:id => slack_integration.to_param, :slack_integration => invalid_attributes} expect(response).to render_template("edit") end end @@ -145,13 +140,13 @@ it "destroys the requested slack_integration" do slack_integration = SlackIntegration.create! valid_attributes expect { - delete :destroy, params: {:id => slack_integration.to_param}, headers: valid_session + delete :destroy, params: {:id => slack_integration.to_param} }.to change(SlackIntegration, :count).by(-1) end it "redirects to the slack_integrations list" do slack_integration = SlackIntegration.create! valid_attributes - delete :destroy, params: {:id => slack_integration.to_param}, headers: valid_session + delete :destroy, params: {:id => slack_integration.to_param} expect(response).to redirect_to(slack_integrations_url) end end diff --git a/spec/controllers/sqs_integrations_controller_spec.rb b/spec/controllers/sqs_integrations_controller_spec.rb index 681e8b58..25071d49 100644 --- a/spec/controllers/sqs_integrations_controller_spec.rb +++ b/spec/controllers/sqs_integrations_controller_spec.rb @@ -35,15 +35,10 @@ } } - # This should return the minimal set of values that should be in the session - # in order to pass any filters (e.g. authentication) defined in - # SqsIntegrationsController. Be sure to keep this updated too. - let(:valid_session) { {} } - describe "GET #index" do it "assigns all sqs_integrations as @sqs_integrations" do sqs_integration = SqsIntegration.create! valid_attributes - get :index, params: {}, headers: valid_session + get :index, params: {} expect(assigns(:sqs_integrations)).to eq([sqs_integration]) end end @@ -51,14 +46,14 @@ describe "GET #show" do it "assigns the requested sqs_integration as @sqs_integration" do sqs_integration = SqsIntegration.create! valid_attributes - get :show, params: {:id => sqs_integration.to_param}, headers: valid_session + get :show, params: {:id => sqs_integration.to_param} expect(assigns(:sqs_integration)).to eq(sqs_integration) end end describe "GET #new" do it "assigns a new sqs_integration as @sqs_integration" do - get :new, params: {}, headers: valid_session + get :new, params: {} expect(assigns(:sqs_integration)).to be_a_new(SqsIntegration) end end @@ -66,7 +61,7 @@ describe "GET #edit" do it "assigns the requested sqs_integration as @sqs_integration" do sqs_integration = SqsIntegration.create! valid_attributes - get :edit, params: {:id => sqs_integration.to_param}, headers: valid_session + get :edit, params: {:id => sqs_integration.to_param} expect(assigns(:sqs_integration)).to eq(sqs_integration) end end @@ -75,30 +70,30 @@ context "with valid params" do it "creates a new SqsIntegration" do expect { - post :create, params: {:sqs_integration => valid_attributes}, headers: valid_session + post :create, params: {:sqs_integration => valid_attributes} }.to change(SqsIntegration, :count).by(1) end it "assigns a newly created sqs_integration as @sqs_integration" do - post :create, params: {:sqs_integration => valid_attributes}, headers: valid_session + post :create, params: {:sqs_integration => valid_attributes} expect(assigns(:sqs_integration)).to be_a(SqsIntegration) expect(assigns(:sqs_integration)).to be_persisted end it "redirects to the intersections path" do - post :create, params: {:sqs_integration => valid_attributes}, headers: valid_session + post :create, params: {:sqs_integration => valid_attributes} expect(response).to redirect_to(integrations_path) end end context "with invalid params" do it "assigns a newly created but unsaved sqs_integration as @sqs_integration" do - post :create, params: {:sqs_integration => invalid_attributes}, headers: valid_session + post :create, params: {:sqs_integration => invalid_attributes} expect(assigns(:sqs_integration)).to be_a_new(SqsIntegration) end it "re-renders the 'new' template" do - post :create, params: {:sqs_integration => invalid_attributes}, headers: valid_session + post :create, params: {:sqs_integration => invalid_attributes} expect(response).to render_template("new") end end @@ -114,7 +109,7 @@ it "updates the requested sqs_integration" do sqs_integration = SqsIntegration.create! valid_attributes - put :update, params: {:id => sqs_integration.to_param, :sqs_integration => new_attributes}, headers: valid_session + put :update, params: {:id => sqs_integration.to_param, :sqs_integration => new_attributes} sqs_integration.reload expect(sqs_integration.queue_url).to eq(new_attributes[:queue_url]) expect(sqs_integration).to be_persisted @@ -122,13 +117,13 @@ it "assigns the requested sqs_integration as @sqs_integration" do sqs_integration = SqsIntegration.create! valid_attributes - put :update, params: {:id => sqs_integration.to_param, :sqs_integration => valid_attributes}, headers: valid_session + put :update, params: {:id => sqs_integration.to_param, :sqs_integration => valid_attributes} expect(assigns(:sqs_integration)).to eq(sqs_integration) end it "redirects to the sqs_integration" do sqs_integration = SqsIntegration.create! valid_attributes - put :update, params: {:id => sqs_integration.to_param, :sqs_integration => valid_attributes}, headers: valid_session + put :update, params: {:id => sqs_integration.to_param, :sqs_integration => valid_attributes} expect(response).to redirect_to(integrations_path) end end @@ -136,13 +131,13 @@ context "with invalid params" do it "assigns the sqs_integration as @sqs_integration" do sqs_integration = SqsIntegration.create! valid_attributes - put :update, params: {:id => sqs_integration.to_param, :sqs_integration => invalid_attributes}, headers: valid_session + put :update, params: {:id => sqs_integration.to_param, :sqs_integration => invalid_attributes} expect(assigns(:sqs_integration)).to eq(sqs_integration) end it "re-renders the 'edit' template" do sqs_integration = SqsIntegration.create! valid_attributes - put :update, params: {:id => sqs_integration.to_param, :sqs_integration => invalid_attributes}, headers: valid_session + put :update, params: {:id => sqs_integration.to_param, :sqs_integration => invalid_attributes} expect(response).to render_template("edit") end end @@ -152,13 +147,13 @@ it "destroys the requested sqs_integration" do sqs_integration = SqsIntegration.create! valid_attributes expect { - delete :destroy, params: {:id => sqs_integration.to_param}, headers: valid_session + delete :destroy, params: {:id => sqs_integration.to_param} }.to change(SqsIntegration, :count).by(-1) end it "redirects to the sqs_integrations list" do sqs_integration = SqsIntegration.create! valid_attributes - delete :destroy, params: {:id => sqs_integration.to_param}, headers: valid_session + delete :destroy, params: {:id => sqs_integration.to_param} expect(response).to redirect_to(integrations_path) end end From 69f86573bce65b9d42f500008bdc9678509de016 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Thu, 6 Sep 2018 10:31:45 +0000 Subject: [PATCH 36/59] Bump jquery-rails from 4.1.1 to 4.3.3 Bumps [jquery-rails](https://github.com/rails/jquery-rails) from 4.1.1 to 4.3.3. - [Release notes](https://github.com/rails/jquery-rails/releases) - [Changelog](https://github.com/rails/jquery-rails/blob/master/CHANGELOG.md) - [Commits](https://github.com/rails/jquery-rails/compare/v4.1.1...v4.3.3) Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 2603ba87..2af8773c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -106,7 +106,7 @@ GEM i18n (1.1.0) concurrent-ruby (~> 1.0) jmespath (1.3.1) - jquery-rails (4.1.1) + jquery-rails (4.3.3) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) From 56011ba131163b4eaab37c9bd357ed833d6344e3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Thu, 6 Sep 2018 10:32:18 +0000 Subject: [PATCH 37/59] Bump letter_opener from 1.4.1 to 1.6.0 Bumps [letter_opener](https://github.com/ryanb/letter_opener) from 1.4.1 to 1.6.0. - [Release notes](https://github.com/ryanb/letter_opener/releases) - [Changelog](https://github.com/ryanb/letter_opener/blob/master/CHANGELOG.md) - [Commits](https://github.com/ryanb/letter_opener/compare/v1.4.1...v1.6.0) Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 2af8773c..585c7e3e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -115,7 +115,7 @@ GEM kramdown (1.17.0) launchy (2.4.3) addressable (~> 2.3) - letter_opener (1.4.1) + letter_opener (1.6.0) launchy (~> 2.2) libv8 (3.16.14.19) listen (3.1.5) From d6f7b6f0beec12dfb69f788f2536dfa3ef31368a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Thu, 6 Sep 2018 10:32:47 +0000 Subject: [PATCH 38/59] Bump byebug from 9.0.5 to 10.0.2 Bumps [byebug](https://github.com/deivid-rodriguez/byebug) from 9.0.5 to 10.0.2. - [Release notes](https://github.com/deivid-rodriguez/byebug/releases) - [Changelog](https://github.com/deivid-rodriguez/byebug/blob/master/CHANGELOG.md) - [Commits](https://github.com/deivid-rodriguez/byebug/compare/v9.0.5...v10.0.2) Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 585c7e3e..0687b9d8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -52,7 +52,7 @@ GEM bcrypt (3.1.12) bindex (0.5.0) builder (3.2.3) - byebug (9.0.5) + byebug (10.0.2) codeclimate-test-reporter (0.5.2) simplecov (>= 0.7.1, < 1.0.0) coderay (1.1.2) From c6cae0b020a180745d9fdc9fa2e0e5882bf774a4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Thu, 6 Sep 2018 10:33:16 +0000 Subject: [PATCH 39/59] Bump simple_form from 3.2.1 to 4.0.1 Bumps [simple_form](https://github.com/plataformatec/simple_form) from 3.2.1 to 4.0.1. - [Release notes](https://github.com/plataformatec/simple_form/releases) - [Changelog](https://github.com/plataformatec/simple_form/blob/master/CHANGELOG.md) - [Commits](https://github.com/plataformatec/simple_form/compare/v3.2.1...v4.0.1) Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index 69607b59..c602b707 100644 --- a/Gemfile +++ b/Gemfile @@ -18,7 +18,7 @@ gem 'bcrypt', '~> 3.1.12' gem 'puma', '~> 3.12' gem 'rails_12factor' -gem 'simple_form', '~> 3.2' +gem 'simple_form', '~> 4.0' gem 'jwt' gem 'premailer-rails' diff --git a/Gemfile.lock b/Gemfile.lock index 0687b9d8..af27cd93 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -236,9 +236,9 @@ GEM sdoc (1.0.0) rdoc (>= 5.0) shellany (0.0.1) - simple_form (3.5.1) - actionpack (> 4, < 5.2) - activemodel (> 4, < 5.2) + simple_form (4.0.1) + actionpack (>= 5.0) + activemodel (>= 5.0) simplecov (0.11.2) docile (~> 1.1.0) json (~> 1.8) @@ -313,7 +313,7 @@ DEPENDENCIES rspec-rails (~> 3.8) sass-rails (~> 5.0) sdoc (~> 1.0.0) - simple_form (~> 3.2) + simple_form (~> 4.0) sinatra spring therubyracer From 4250607671140343a234c150ae5e6f312393cf60 Mon Sep 17 00:00:00 2001 From: Gabe Isman Date: Thu, 6 Sep 2018 11:31:22 -0400 Subject: [PATCH 40/59] Fix broken images. --- app/models/slack_integration.rb | 2 +- {app/assets => public}/images/bookmarklet.png | Bin {app/assets => public}/images/compare_versions.png | Bin {app/assets => public}/images/klaxon-logo-100px.png | Bin {docs => public/images}/privacy_badger_dialog.PNG | Bin {docs => public/images}/privacy_badger_settings.PNG | Bin spec/models/slack_integration_spec.rb | 2 +- 7 files changed, 2 insertions(+), 2 deletions(-) rename {app/assets => public}/images/bookmarklet.png (100%) rename {app/assets => public}/images/compare_versions.png (100%) rename {app/assets => public}/images/klaxon-logo-100px.png (100%) rename {docs => public/images}/privacy_badger_dialog.PNG (100%) rename {docs => public/images}/privacy_badger_settings.PNG (100%) diff --git a/app/models/slack_integration.rb b/app/models/slack_integration.rb index 9c999ab4..da2a7fb7 100644 --- a/app/models/slack_integration.rb +++ b/app/models/slack_integration.rb @@ -38,7 +38,7 @@ def send_notification(change) page_name = change&.after&.page&.name text = "#{page_name} changed #{page_change_url(change)}" - icon_url = URI.join(root_url, ActionController::Base.helpers.asset_path("klaxon-logo-100px.png")).to_s + icon_url = URI.join(root_url, '/images/klaxon-logo-100px.png').to_s payload = { "username": "Klaxon", diff --git a/app/assets/images/bookmarklet.png b/public/images/bookmarklet.png similarity index 100% rename from app/assets/images/bookmarklet.png rename to public/images/bookmarklet.png diff --git a/app/assets/images/compare_versions.png b/public/images/compare_versions.png similarity index 100% rename from app/assets/images/compare_versions.png rename to public/images/compare_versions.png diff --git a/app/assets/images/klaxon-logo-100px.png b/public/images/klaxon-logo-100px.png similarity index 100% rename from app/assets/images/klaxon-logo-100px.png rename to public/images/klaxon-logo-100px.png diff --git a/docs/privacy_badger_dialog.PNG b/public/images/privacy_badger_dialog.PNG similarity index 100% rename from docs/privacy_badger_dialog.PNG rename to public/images/privacy_badger_dialog.PNG diff --git a/docs/privacy_badger_settings.PNG b/public/images/privacy_badger_settings.PNG similarity index 100% rename from docs/privacy_badger_settings.PNG rename to public/images/privacy_badger_settings.PNG diff --git a/spec/models/slack_integration_spec.rb b/spec/models/slack_integration_spec.rb index 99cb94b1..cb5f4191 100644 --- a/spec/models/slack_integration_spec.rb +++ b/spec/models/slack_integration_spec.rb @@ -14,7 +14,7 @@ payload = slack.send_notification(change) expect(payload[:icon_url]).to start_with 'http' - expect(payload[:icon_url]).to include '/assets/klaxon-logo' + expect(payload[:icon_url]).to include '/images/klaxon-logo' expect(payload[:channel]).to eq slack.channel expect(payload[:username]).to include "Klaxon" expect(payload[:text]).to include page.name From 8309ff2f8836a4be786080e024e0021b3e029480 Mon Sep 17 00:00:00 2001 From: Gabe Isman Date: Thu, 6 Sep 2018 11:31:33 -0400 Subject: [PATCH 41/59] Update help. --- data/help.md | 69 ++++++++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 35 deletions(-) diff --git a/data/help.md b/data/help.md index 97a4f91e..e06a7eb3 100644 --- a/data/help.md +++ b/data/help.md @@ -4,54 +4,29 @@ Klaxon is a tool that enables journalists and researchers to monitor scores of w #Bookmark Set-Up -Working with Klaxon requires the one-time setup of a bookmarklet. Once the bookmarklet is added to your browser, clicking on it will allow you to save a page. +Working with Klaxon requires the one-time setup of a bookmarklet. Once the bookmarklet is added to your browser, clicking on it will allow you to save a page. -To add the bookmarklet, visit the Klaxon website. The first time you visit you'll notice a box that says “Watch Your First Item.” Underneath that, you’ll see a button that says “Add to Klaxon.” Click and drag that button to the bookmarks bar on your browser. Now anytime you’re on a site you want follow through Klaxon, you can click on the bookmarklet *without having to leave the site*. This works similarly to services like Digg and Pinterest. +To add the bookmarklet, visit the Klaxon website. The first time you visit you'll notice a box that says “Watch Your First Item.” Underneath that, you’ll see a button that says “Add to Klaxon.” Click and drag that button to the bookmarks bar on your browser. Now anytime you’re on a site you want follow through Klaxon, you can click on the bookmarklet *without having to leave the site*. This works similarly to services like Digg and Pinterest. Clicking on the bookmark will open a popup on the right side of your browser window. As you move your mouse around the page, different sections are highlighted. Web pages have images, files, tables and text that live in specific sections of the HTML document. With your mouse, you can select a table row (tr), paragraph (p), headline (h2) or the whole body of text (body). These selectors tell Klaxon *which* part of the page to follow, so you’ll only get alerts when that specific section changes. To tell Klaxon where to look, hover your mouse over different sections of the page. Notice how each section is highlighted in red when you hover. This is one indicator to help Klaxon home in on the right area. -![](/assets/bookmarklet.png) +![Example of choosing an element to watch](/images/bookmarklet.png) When you think you have highlighted the correct section of the page—say the list of Supreme Court decisions, or the latest documents in next year’s state budget—click the mouse. Now, look under the “Save and Edit” box in the Klaxon window, and you’ll notice it says “Done!” That means that Klaxon has saved this page and will start watching it for you. -Before you close the window though, see the red box under the heading “Content Preview?” That shows you what information is captured in the section of the page you selected. If the words you see in the red box don’t match what you’re hoping to monitor, you might have chosen the wrong part of the page. Not to worry, you can hover and click on any different section of the page until you get the right area selected and saved. +Before you close the window though, see the red box under the heading “Content Preview?” That shows you what information is captured in the section of the page you selected. If the words you see in the red box don’t match what you’re hoping to monitor, you might have chosen the wrong part of the page. Not to worry, you can hover and click on any different section of the page until you get the right area selected and saved. For the last step, you’ll want to click the ‘Save and Edit’ button, which will bring you back to Klaxon so you can give this page a name (like a slug) in the system. -#### Bookmarklet not working? - -In some cases, certain Chrome extensions may break the bookmarklet. -In some cases, it may look somethings like this: - -!["example of broken bookmarlet"](https://user-images.githubusercontent.com/190733/28034680-8375a8a2-6577-11e7-86fd-c594d35bd4b1.png) - -For example, the Electronic Frontier Foundation's ["Privacy Badger"](https://www.eff.org/privacybadger) is a script blocker. When you use Klaxon in addition to Privacy Badger, EFF's extension detects Klaxon as a script and blocks it. This breaks the service. - -The solution: - -Whitelist your organization’s specific Klaxon in Privacy Badger. - -To do this, click on the Privacy Badger icon in your Chrome extension bar. A dialog box should appear. Click the gear in the upper right hand corner of the dialog box. This will open Privacy Badger Settings in a new tab. - -!["Privac Badger Dialog box"](/docs/privacy_badger_dialog.PNG) - -There should be a tab for "Whitelisted Domains" in your Privacy Badger settings. Go to that and add your organization's Klaxon (XXX-klaxon.herokuapp.com) to it. Click add domain. - -!["Privac Badger Dialog settings"](/docs/privacy_badger_settings.PNG) - -This should fix this issue. Apply the same logic for other extensions that might cause Klaxon to not work. - -For further reference on these issues, refer to issues [#135](https://github.com/themarshallproject/klaxon/issues/135) and [#138](https://github.com/themarshallproject/klaxon/issues/138). - ## The Feed -In [the Feed](/) you'll find a list of recent snapshots of pages people in your newsroom are following. This is a good place to see what’s new in the system and to discover and subscribe to Klaxons that other reporters or editors find useful. These links are in order of most recent changes. You will also get a team summary of how many changes have been monitored, the number of pages the team is following and how many users are using Klaxon. +In [the Feed](/) you'll find a list of recent snapshots of pages people in your newsroom are following. This is a good place to see what’s new in the system and to discover and subscribe to Klaxons that other reporters or editors find useful. These links are in order of most recent changes. You will also get a team summary of how many changes have been monitored, the number of pages the team is following and how many users are using Klaxon. If you want to step back through each stage of the site’s evolution, you can explore its history on the “[Watching](/watching/pages)” page. ## Watching -The “[Watching](/watching/pages)” page displays a list of all the pages that your newsroom is monitoring (as opposed to a chronological stream of the latest updates as seen in the [Feed](/)). Here you can also change settings for individual pages. +The “[Watching](/watching/pages)” page displays a list of all the pages that your newsroom is monitoring (as opposed to a chronological stream of the latest updates as seen in the [Feed](/)). Here you can also change settings for individual pages. To change the name or URL of any of the Klaxons you’ve created or to adjust their notification settings, simply click the “Edit” button next to the appropriate page. You can also click into each to view the differences of each snapshot the system has collected since you added it to Klaxon. @@ -63,17 +38,17 @@ To make it easier to keep track of what’s significant about each change and to In the “[Watching](/watching/pages)” page you can manually add sites to monitor if you already know which CSS Selector on the page you want to follow or are having difficulty with the bookmarklet. -Click on "Manually Watch and Item" on the right side of the heading. This will take you to directly to the Edit page for links. Here you can include the title, link to the site and the specific selector(s) you want to focus on. +Click on "Manually Watch and Item" on the right side of the heading. This will take you to directly to the Edit page for links. Here you can include the title, link to the site and the specific selector(s) you want to focus on. ## Understand what’s changed on a page -Sometimes you want to see how the current version of a site compares to a version that you captured, say, six months ago. Because Klaxon stores each snapshot it finds of a site, this is fairly easy to do. You can reach the history of snapshots in a couple of ways. If it’s a site someone else in your newsroom is following, from the Feed, click on the latest snapshot you see for your site, which would say something like “GA Sec’y of State changed” or “The Marshall Project changed”. If it’s a site you added to Klaxon, from the “Watching” page, click on the “Latest snapshot” button next the site you want to explore. Either of these routes takes you to the most recent snapshot for that site. +Sometimes you want to see how the current version of a site compares to a version that you captured, say, six months ago. Because Klaxon stores each snapshot it finds of a site, this is fairly easy to do. You can reach the history of snapshots in a couple of ways. If it’s a site someone else in your newsroom is following, from the Feed, click on the latest snapshot you see for your site, which would say something like “GA Sec’y of State changed” or “The Marshall Project changed”. If it’s a site you added to Klaxon, from the “Watching” page, click on the “Latest snapshot” button next the site you want to explore. Either of these routes takes you to the most recent snapshot for that site. Now, click the “Past snapshots” button in the upper right corner. This takes you to a list of every snapshot Klaxon has captured of the site in question. -![](/assets/compare_versions.png) +![Example of comparing two snapshots](/images/compare_versions.png) -First, select the “older” version from the left column that you want to be the basis of comparison. Then, in the right column, select the “newer” snapshot from the list. Finally, click the compare button. This takes you to a new page to compare the snapshots. The difference between the two pages will be displayed just as it is in the “Latest snapshot” page: additions to the site will be highlighted in green, deletions will be marked in red. Using the “Past snapshots” list, you can step through every change, one at a time, to find the update you’re looking for. When you find what you’re looking for, add a note in the “What’s Changed” field to make it easier to find later when you need it. +First, select the “older” version from the left column that you want to be the basis of comparison. Then, in the right column, select the “newer” snapshot from the list. Finally, click the compare button. This takes you to a new page to compare the snapshots. The difference between the two pages will be displayed just as it is in the “Latest snapshot” page: additions to the site will be highlighted in green, deletions will be marked in red. Using the “Past snapshots” list, you can step through every change, one at a time, to find the update you’re looking for. When you find what you’re looking for, add a note in the “What’s Changed” field to make it easier to find later when you need it. ## How to add notifications to a Slack channel @@ -89,3 +64,27 @@ Built and refined in the newsroom of [The Marshall Project](https://www.themarsh When we release major changes to Klaxon, we’ll make an announcement to our [Google Group email list](https://groups.google.com/forum/#!forum/news-klaxon-users). At that point, you’ll likely want to adopt those in your system as well. To do that, you can find [everything you'll need to upgrade here](https://github.com/themarshallproject/klaxon#applying-upgrades-as-the-project-develops). +## Bookmarklet not working? + +In some cases, certain Chrome extensions may break the bookmarklet. +It may look something like this: + +![example of broken bookmarlet](https://user-images.githubusercontent.com/190733/28034680-8375a8a2-6577-11e7-86fd-c594d35bd4b1.png) + +For example, the Electronic Frontier Foundation's ["Privacy Badger"](https://www.eff.org/privacybadger) is a script blocker. When you use Klaxon in addition to Privacy Badger, the extension detects Klaxon as a script and blocks it. This breaks the service. + +The solution: + +Whitelist your organization’s specific Klaxon in Privacy Badger. + +To do this, click on the Privacy Badger icon in your Chrome extension bar. A dialog box should appear. Click the gear in the upper right hand corner of the dialog box. This will open Privacy Badger Settings in a new tab. + +![Privacy Badger Dialog box](/images/privacy_badger_dialog.PNG) + +There should be a tab for "Whitelisted Domains" in your Privacy Badger settings. Go to that and add your organization's Klaxon (XXX-klaxon.herokuapp.com) to it. Click add domain. + +![Privacy Badger Dialog settings](/images/privacy_badger_settings.PNG) + +This should fix this issue. Apply the same logic for other ad-blocking, tracking-prevention extensions that might cause Klaxon to not work. + +For further reference on these issues, refer to issues [#135](https://github.com/themarshallproject/klaxon/issues/135) and [#138](https://github.com/themarshallproject/klaxon/issues/138). From afb94c4f9785544e85636c9c80708718f44e2748 Mon Sep 17 00:00:00 2001 From: Grey Baker Date: Fri, 7 Sep 2018 14:37:08 +0100 Subject: [PATCH 42/59] Switch from aws-sdk to aws-sdk-sqs --- Gemfile | 3 +-- Gemfile.lock | 19 +++++++++++-------- app/lib/sqs_notification.rb | 16 +++++++--------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Gemfile b/Gemfile index c602b707..c8cc821d 100644 --- a/Gemfile +++ b/Gemfile @@ -27,8 +27,7 @@ gem 'httparty' gem 'diffy' gem 'kramdown' -# only used for alerting SQS. -gem 'aws-sdk', '~> 2.0' +gem 'aws-sdk-sqs', '~> 1.6' group :development, :test do gem 'byebug' diff --git a/Gemfile.lock b/Gemfile.lock index af27cd93..e54405de 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -41,14 +41,17 @@ GEM addressable (2.5.2) public_suffix (>= 2.0.2, < 4.0) arel (8.0.0) - aws-sdk (2.6.26) - aws-sdk-resources (= 2.6.26) - aws-sdk-core (2.6.26) + aws-eventstream (1.0.1) + aws-partitions (1.103.0) + aws-sdk-core (3.27.0) + aws-eventstream (~> 1.0) + aws-partitions (~> 1.0) aws-sigv4 (~> 1.0) jmespath (~> 1.0) - aws-sdk-resources (2.6.26) - aws-sdk-core (= 2.6.26) - aws-sigv4 (1.0.0) + aws-sdk-sqs (1.6.0) + aws-sdk-core (~> 3, >= 3.26.0) + aws-sigv4 (~> 1.0) + aws-sigv4 (1.0.3) bcrypt (3.1.12) bindex (0.5.0) builder (3.2.3) @@ -105,7 +108,7 @@ GEM multi_xml (>= 0.5.2) i18n (1.1.0) concurrent-ruby (~> 1.0) - jmespath (1.3.1) + jmespath (1.4.0) jquery-rails (4.3.3) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) @@ -288,7 +291,7 @@ PLATFORMS ruby DEPENDENCIES - aws-sdk (~> 2.0) + aws-sdk-sqs (~> 1.6) bcrypt (~> 3.1.12) byebug codeclimate-test-reporter diff --git a/app/lib/sqs_notification.rb b/app/lib/sqs_notification.rb index 7abf5682..e98ea7f7 100644 --- a/app/lib/sqs_notification.rb +++ b/app/lib/sqs_notification.rb @@ -1,5 +1,3 @@ -require 'aws-sdk' - class SqsNotification def self.perform(queue_url, payload) client = Aws::SQS::Client.new( @@ -11,16 +9,16 @@ def self.perform(queue_url, payload) begin return client.send_message({ - delay_seconds: 10, + delay_seconds: 10, message_attributes: { "payload" => { - data_type: "String", - string_value: json, + data_type: "String", + string_value: json, } - }, - message_body: json, - queue_url: queue_url, - }) + }, + message_body: json, + queue_url: queue_url, + }) rescue Aws::SQS::Errors::ServiceError => e puts "Error sending SQS message to queue_url=#{queue_url} for payload=#{payload.to_json}; Error: #{e}" return false From 682065f6e0851ff6f19582dd770398c95ffadd1a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 10 Sep 2018 11:03:03 +0000 Subject: [PATCH 43/59] Bump factory_bot_rails from 4.11.0 to 4.11.1 Bumps [factory_bot_rails](https://github.com/thoughtbot/factory_bot_rails) from 4.11.0 to 4.11.1. - [Release notes](https://github.com/thoughtbot/factory_bot_rails/releases) - [Changelog](https://github.com/thoughtbot/factory_bot_rails/blob/master/NEWS) - [Commits](https://github.com/thoughtbot/factory_bot_rails/compare/v4.11.0...v4.11.1) Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index c8cc821d..c9622ef3 100644 --- a/Gemfile +++ b/Gemfile @@ -33,7 +33,7 @@ group :development, :test do gem 'byebug' gem 'rspec-rails', '~> 3.8' gem 'guard-rspec', require: false - gem 'factory_bot_rails', '~> 4.0' + gem 'factory_bot_rails', '~> 4.11' gem 'database_cleaner' gem 'sinatra' end diff --git a/Gemfile.lock b/Gemfile.lock index e54405de..382d9886 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -79,10 +79,10 @@ GEM dotenv (2.5.0) erubi (1.7.1) execjs (2.7.0) - factory_bot (4.11.0) + factory_bot (4.11.1) activesupport (>= 3.0.0) - factory_bot_rails (4.11.0) - factory_bot (~> 4.11.0) + factory_bot_rails (4.11.1) + factory_bot (~> 4.11.1) railties (>= 3.0.0) ffi (1.9.25) formatador (0.2.5) @@ -299,7 +299,7 @@ DEPENDENCIES database_cleaner diffy dotenv - factory_bot_rails (~> 4.0) + factory_bot_rails (~> 4.11) guard-rspec httparty jquery-rails From f364c9b85fe6ab09fbd7e03020ed17b75b344ec6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Fri, 7 Sep 2018 10:35:01 +0000 Subject: [PATCH 44/59] Bump rails from 5.1.6 to 5.2.1 Bumps [rails](https://github.com/rails/rails) from 5.1.6 to 5.2.1. - [Release notes](https://github.com/rails/rails/releases) - [Commits](https://github.com/rails/rails/compare/v5.1.6...v5.2.1) Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 84 ++++++++++++++++++++++++++++------------------------ 2 files changed, 47 insertions(+), 39 deletions(-) diff --git a/Gemfile b/Gemfile index c8cc821d..55744d71 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source 'https://rubygems.org' ruby '2.3.4' -gem 'rails', '~> 5.1.6' +gem 'rails', '~> 5.2.1' gem 'pg', '~> 0.21' gem 'sass-rails', '~> 5.0' gem 'uglifier', '>= 1.3.0' diff --git a/Gemfile.lock b/Gemfile.lock index e54405de..2a7e620e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,46 +1,50 @@ GEM remote: https://rubygems.org/ specs: - actioncable (5.1.6) - actionpack (= 5.1.6) + actioncable (5.2.1) + actionpack (= 5.2.1) nio4r (~> 2.0) - websocket-driver (~> 0.6.1) - actionmailer (5.1.6) - actionpack (= 5.1.6) - actionview (= 5.1.6) - activejob (= 5.1.6) + websocket-driver (>= 0.6.1) + actionmailer (5.2.1) + actionpack (= 5.2.1) + actionview (= 5.2.1) + activejob (= 5.2.1) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (5.1.6) - actionview (= 5.1.6) - activesupport (= 5.1.6) + actionpack (5.2.1) + actionview (= 5.2.1) + activesupport (= 5.2.1) rack (~> 2.0) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.1.6) - activesupport (= 5.1.6) + actionview (5.2.1) + activesupport (= 5.2.1) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (5.1.6) - activesupport (= 5.1.6) + activejob (5.2.1) + activesupport (= 5.2.1) globalid (>= 0.3.6) - activemodel (5.1.6) - activesupport (= 5.1.6) - activerecord (5.1.6) - activemodel (= 5.1.6) - activesupport (= 5.1.6) - arel (~> 8.0) - activesupport (5.1.6) + activemodel (5.2.1) + activesupport (= 5.2.1) + activerecord (5.2.1) + activemodel (= 5.2.1) + activesupport (= 5.2.1) + arel (>= 9.0) + activestorage (5.2.1) + actionpack (= 5.2.1) + activerecord (= 5.2.1) + marcel (~> 0.3.1) + activesupport (5.2.1) concurrent-ruby (~> 1.0, >= 1.0.2) 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) aws-eventstream (1.0.1) aws-partitions (1.103.0) aws-sdk-core (3.27.0) @@ -131,7 +135,10 @@ GEM lumberjack (1.0.13) mail (2.7.0) mini_mime (>= 0.1.1) + marcel (0.3.2) + mimemagic (~> 0.3.2) method_source (0.9.0) + mimemagic (0.3.2) mini_mime (1.0.1) mini_portile2 (2.3.0) minitest (5.11.3) @@ -164,17 +171,18 @@ GEM rack rack-test (1.1.0) rack (>= 1.0, < 3) - rails (5.1.6) - actioncable (= 5.1.6) - actionmailer (= 5.1.6) - actionpack (= 5.1.6) - actionview (= 5.1.6) - activejob (= 5.1.6) - activemodel (= 5.1.6) - activerecord (= 5.1.6) - activesupport (= 5.1.6) + rails (5.2.1) + actioncable (= 5.2.1) + actionmailer (= 5.2.1) + actionpack (= 5.2.1) + actionview (= 5.2.1) + activejob (= 5.2.1) + activemodel (= 5.2.1) + activerecord (= 5.2.1) + activestorage (= 5.2.1) + activesupport (= 5.2.1) bundler (>= 1.3.0) - railties (= 5.1.6) + railties (= 5.2.1) sprockets-rails (>= 2.0.0) rails-controller-testing (1.0.2) actionpack (~> 5.x, >= 5.0.1) @@ -190,12 +198,12 @@ GEM rails_stdout_logging rails_serve_static_assets (0.0.5) rails_stdout_logging (0.0.5) - railties (5.1.6) - actionpack (= 5.1.6) - activesupport (= 5.1.6) + railties (5.2.1) + actionpack (= 5.2.1) + activesupport (= 5.2.1) method_source rake (>= 0.8.7) - thor (>= 0.18.1, < 2.0) + thor (>= 0.19.0, < 2.0) rake (12.3.1) rb-fsevent (0.10.3) rb-inotify (0.9.10) @@ -283,7 +291,7 @@ GEM addressable (>= 2.3.6) crack (>= 0.3.2) hashdiff - websocket-driver (0.6.5) + websocket-driver (0.7.0) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.3) @@ -310,7 +318,7 @@ DEPENDENCIES premailer-rails puma (~> 3.12) rack-cache - rails (~> 5.1.6) + rails (~> 5.2.1) rails-controller-testing rails_12factor rspec-rails (~> 3.8) From 556f884e7fba9024ead4dfb2af5d0667d25412a0 Mon Sep 17 00:00:00 2001 From: Grey Baker Date: Fri, 7 Sep 2018 14:29:13 +0100 Subject: [PATCH 45/59] Add bootsnap and turn off cookie encryption (until working in production) --- Gemfile | 1 + Gemfile.lock | 4 ++++ config/boot.rb | 3 ++- config/environments/production.rb | 4 ++++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 55744d71..d0cd97b6 100644 --- a/Gemfile +++ b/Gemfile @@ -10,6 +10,7 @@ gem 'therubyracer' gem 'dotenv' gem 'jquery-rails' gem 'turbolinks' +gem 'bootsnap', require: false gem 'coffee-rails' gem 'sdoc', '~> 1.0.0', group: :doc diff --git a/Gemfile.lock b/Gemfile.lock index 2a7e620e..40e93283 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -58,6 +58,8 @@ GEM aws-sigv4 (1.0.3) bcrypt (3.1.12) bindex (0.5.0) + bootsnap (1.3.1) + msgpack (~> 1.0) builder (3.2.3) byebug (10.0.2) codeclimate-test-reporter (0.5.2) @@ -142,6 +144,7 @@ GEM mini_mime (1.0.1) mini_portile2 (2.3.0) minitest (5.11.3) + msgpack (1.2.4) multi_xml (0.6.0) mustermann (1.0.3) nenv (0.3.0) @@ -301,6 +304,7 @@ PLATFORMS DEPENDENCIES aws-sdk-sqs (~> 1.6) bcrypt (~> 3.1.12) + bootsnap byebug codeclimate-test-reporter coffee-rails diff --git a/config/boot.rb b/config/boot.rb index 6b750f00..b9e460ce 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -1,3 +1,4 @@ -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) require 'bundler/setup' # Set up gems listed in the Gemfile. +require 'bootsnap/setup' # Speed up boot time by caching expensive operations. diff --git a/config/environments/production.rb b/config/environments/production.rb index fc028a47..4837b34e 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -41,6 +41,10 @@ # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX + # TODO: Remove this once Rails 5.2 has been deployed to production and is + # working fine + config.action_dispatch.use_authenticated_cookie_encryption = false + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. config.force_ssl = true From 20fe8fe103da7ec50060427caac2d9e6b6a6cd99 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 12 Sep 2018 10:27:02 +0000 Subject: [PATCH 46/59] Bump uglifier from 4.1.18 to 4.1.19 Bumps [uglifier](https://github.com/lautis/uglifier) from 4.1.18 to 4.1.19. - [Release notes](https://github.com/lautis/uglifier/releases) - [Changelog](https://github.com/lautis/uglifier/blob/master/CHANGELOG.md) - [Commits](https://github.com/lautis/uglifier/compare/v4.1.18...v4.1.19) Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index e54405de..76294d54 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -272,7 +272,7 @@ GEM turbolinks-source (5.2.0) tzinfo (1.2.5) thread_safe (~> 0.1) - uglifier (4.1.18) + uglifier (4.1.19) execjs (>= 0.3.0, < 3) web-console (3.7.0) actionview (>= 5.0) From 67dbd2fbb3a2798b03ef93f2cbbb3155d50610b5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 17 Sep 2018 11:02:03 +0000 Subject: [PATCH 47/59] Bump sinatra from 2.0.3 to 2.0.4 Bumps [sinatra](https://github.com/sinatra/sinatra) from 2.0.3 to 2.0.4. - [Release notes](https://github.com/sinatra/sinatra/releases) - [Changelog](https://github.com/sinatra/sinatra/blob/master/CHANGELOG.md) - [Commits](https://github.com/sinatra/sinatra/compare/v2.0.3...v2.0.4) Signed-off-by: dependabot[bot] --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index e54405de..d1ead95d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -160,7 +160,7 @@ GEM rack (2.0.5) rack-cache (1.8.0) rack (>= 0.4) - rack-protection (2.0.3) + rack-protection (2.0.4) rack rack-test (1.1.0) rack (>= 1.0, < 3) @@ -247,10 +247,10 @@ GEM json (~> 1.8) simplecov-html (~> 0.10.0) simplecov-html (0.10.0) - sinatra (2.0.3) + sinatra (2.0.4) mustermann (~> 1.0) rack (~> 2.0) - rack-protection (= 2.0.3) + rack-protection (= 2.0.4) tilt (~> 2.0) spring (2.0.2) activesupport (>= 4.2) From 6d2b60b7fcac4ade32f5cddb8e53436d3825938e Mon Sep 17 00:00:00 2001 From: Gabe Isman Date: Tue, 25 Sep 2018 16:06:55 -0400 Subject: [PATCH 48/59] Fix email notifications broken in upgrade to Rails 5.0 --- app/mailers/change_mailer.rb | 2 -- app/models/user.rb | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/app/mailers/change_mailer.rb b/app/mailers/change_mailer.rb index e291e9af..b6646b19 100644 --- a/app/mailers/change_mailer.rb +++ b/app/mailers/change_mailer.rb @@ -1,5 +1,4 @@ class ChangeMailer < ApplicationMailer - def page(user: nil, change: nil) @change = change @page = @change.after.page @@ -7,5 +6,4 @@ def page(user: nil, change: nil) mail(to: @user.email, subject: "#{@page.name} changed") end - end diff --git a/app/models/user.rb b/app/models/user.rb index 323044a6..832c6a41 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -35,7 +35,7 @@ def is_subscribed_to?(watchable) def send_notification(change) puts "user#send_notification #{self.email}" - ChangeMailer.page(change: change, user: self).deliver_later + ChangeMailer.page(change: change, user: self).deliver_now end def email_domain_is_approved From 89d33e09228b95c1c025dfecdfd29ccbd060a301 Mon Sep 17 00:00:00 2001 From: Gabe Isman Date: Tue, 25 Sep 2018 16:52:37 -0400 Subject: [PATCH 49/59] Upgrade to Ruby 2.4.4 --- .ruby-version | 2 +- Gemfile | 2 +- Gemfile.lock | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.ruby-version b/.ruby-version index 3f684d2d..79a61441 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.3.4 +2.4.4 diff --git a/Gemfile b/Gemfile index 34ba95dd..0b43c3b2 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,5 @@ source 'https://rubygems.org' -ruby '2.3.4' +ruby '2.4.4' gem 'rails', '~> 5.2.1' gem 'pg', '~> 0.21' diff --git a/Gemfile.lock b/Gemfile.lock index 48e960b0..596294f1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -338,7 +338,7 @@ DEPENDENCIES webmock RUBY VERSION - ruby 2.3.4p301 + ruby 2.4.4p296 BUNDLED WITH 1.16.3 From a9dcbdbd42eb1568a8bdc94c5553199886cb7587 Mon Sep 17 00:00:00 2001 From: Gabe Isman Date: Tue, 25 Sep 2018 17:09:46 -0400 Subject: [PATCH 50/59] Fix tests. --- spec/models/change_spec.rb | 5 ++--- spec/requests/change_spec.rb | 9 +-------- spec/spec_helper.rb | 4 ++++ 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/spec/models/change_spec.rb b/spec/models/change_spec.rb index 06d50efd..b45f90cd 100644 --- a/spec/models/change_spec.rb +++ b/spec/models/change_spec.rb @@ -48,8 +48,7 @@ last_change = Change.order('created_at DESC').first expect(last_change.before).to eq expect_before expect(last_change.after).to eq expect_after - - assert_enqueued_jobs 1 # (and not more than 1) + expect(ActionMailer::Base.deliveries.length).to eq 1 end it "doesnt send anything if there is only one snapshot for a page" do @@ -63,7 +62,7 @@ # perform Change.check - assert_enqueued_jobs 0 # (and not more than 0) + expect(ActionMailer::Base.deliveries.length).to eq 0 end end diff --git a/spec/requests/change_spec.rb b/spec/requests/change_spec.rb index 3539ca7d..cbc7c599 100644 --- a/spec/requests/change_spec.rb +++ b/spec/requests/change_spec.rb @@ -12,7 +12,6 @@ end it "can create multiple snapshots and send an email based on the last pair" do - stub_request(:any, /faketimeserver.com/).to_rack(FakeTimeServer) page = Page.create!(url: "http://faketimeserver.com/now", user: @user, css_selector: 'body') @@ -27,12 +26,6 @@ Change.check - assert_enqueued_jobs 1 # even though we had three snapshots, expect just one email - - ## TODO: WIP! - + expect(ActionMailer::Base.deliveries.length).to eq 1 # even though we had three snapshots, expect just one email end - - - end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index babfb0cb..a9e4ccf1 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -43,6 +43,10 @@ mocks.verify_partial_doubles = true end + # Clear out all sent emails before each test + config.before(:each) { ActionMailer::Base.deliveries.clear } + + # The settings below are suggested to provide a good initial experience # with RSpec, but feel free to customize to your heart's content. =begin From f31a8689d5347eceaee794c332aab5b047136634 Mon Sep 17 00:00:00 2001 From: Gabe Isman Date: Tue, 25 Sep 2018 17:14:06 -0400 Subject: [PATCH 51/59] Turning back on encrypted cookies. Cookies seem to be working perfectly in production. --- config/environments/production.rb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/config/environments/production.rb b/config/environments/production.rb index 4837b34e..fc028a47 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -41,10 +41,6 @@ # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX - # TODO: Remove this once Rails 5.2 has been deployed to production and is - # working fine - config.action_dispatch.use_authenticated_cookie_encryption = false - # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. config.force_ssl = true From c5b7e6c21d8fe82b1f216e70ddff67fc92f9ef68 Mon Sep 17 00:00:00 2001 From: Gabe Isman Date: Tue, 25 Sep 2018 17:28:49 -0400 Subject: [PATCH 52/59] Migrate to circle 2.0 --- .circleci/config.yml | 99 ++++++++++++++++++++++++++++++++++++++++++++ circle.yml | 8 ---- 2 files changed, 99 insertions(+), 8 deletions(-) create mode 100644 .circleci/config.yml delete mode 100644 circle.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..2da97a0f --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,99 @@ +version: 2 +jobs: + build: + working_directory: ~/themarshallproject/klaxon + parallelism: 1 + docker: + # Includes ruby, node, and chrome/phantomjs + # TODO: Go back to the non-legacy version of this image, when our test + # infrastructure no longer depends on phantomjs + - image: circleci/ruby:2.4 # ...with this image as the primary container; this is where all `steps` will run + environment: # environment variables for primary container + BUNDLE_JOBS: 3 + BUNDLE_RETRY: 3 + BUNDLE_PATH: vendor/bundle + PGHOST: 127.0.0.1 + PGUSER: klaxon-test-user + RAILS_ENV: test + RACK_ENV: test + NODE_ENV: test + - image: circleci/postgres:9.5-alpine # database image + environment: # environment variables for database + POSTGRES_USER: klaxon-test-user + POSTGRES_DB: klaxon_test + POSTGRES_PASSWORD: "" + steps: + # Check out the repo + - checkout + + # Dependencies + # Which version of bundler? + - run: + name: Which bundler? + command: bundle -v + + # Restore the dependency cache + - restore_cache: + keys: + - klaxon-v2-{{ checksum "Gemfile.lock" }}- + - klaxon-v2- + + - run: + name: Bundle Install + command: bundle check || bundle install + + # Store bundle cache + - save_cache: + key: klaxon-v2-{{ checksum "Gemfile.lock" }}- + paths: + - vendor/bundle + + - run: + name: Compile assets + command: bundle exec rake assets:precompile assets:clean + environment: + RAILS_GROUPS: assets + + - run: + command: bundle exec rake db:create db:schema:load --trace + environment: + RAILS_ENV: test + RACK_ENV: test + + - run: + name: Make results directory + command: mkdir -p test-results/rspec/ + + - run: + name: Wait for DB + command: dockerize -wait tcp://localhost:5432 -timeout 1m + + - run: + name: Run the tests + command: bundle exec rspec -r rspec_junit_formatter --format RspecJunitFormatter -o test-results/rspec/rspec.xml + + # Save test results for reporting in the UI + - store_test_results: + path: test-results + + deploy: + docker: + - image: buildpack-deps:trusty + steps: + - checkout + - run: + name: Deploy to Heroku + command: | + git push https://heroku:$HEROKU_API_KEY@git.heroku.com/the-marshall-project-klaxon.git master + +workflows: + version: 2 + build-deploy: + jobs: + - build + - deploy: + requires: + - build + filters: + branches: + only: develop diff --git a/circle.yml b/circle.yml deleted file mode 100644 index 9dc0061e..00000000 --- a/circle.yml +++ /dev/null @@ -1,8 +0,0 @@ -deployment: - production: - branch: master - commands: - - "[[ ! -s \"$(git rev-parse --git-dir)/shallow\" ]] || git fetch --unshallow" - - git push git@heroku.com:klaxon-demo.git $CIRCLE_SHA1:refs/heads/master - - heroku run rake db:migrate --app klaxon-demo: - timeout: 400 From 5d19cf354eec142234e5fb00a3cd2e9ffdfa8991 Mon Sep 17 00:00:00 2001 From: Gabe Isman Date: Tue, 25 Sep 2018 17:35:49 -0400 Subject: [PATCH 53/59] Fix test database user. --- config/database.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/database.yml b/config/database.yml index 0d1313ca..0d0e821e 100644 --- a/config/database.yml +++ b/config/database.yml @@ -13,7 +13,7 @@ development: test: <<: *default database: klaxon_test - username: <%= `whoami` %> + username: <%= ENV['PGUSER'] || `whoami` %> host: localhost port: 5432 From cfe1e88d3e75ba2f70917ec080ae0e01610ca475 Mon Sep 17 00:00:00 2001 From: Gabe Isman Date: Tue, 25 Sep 2018 17:38:04 -0400 Subject: [PATCH 54/59] Add rspec_junit_formatter. --- Gemfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Gemfile b/Gemfile index 0b43c3b2..0422b4c6 100644 --- a/Gemfile +++ b/Gemfile @@ -42,6 +42,7 @@ end group :test do gem 'webmock' gem 'rails-controller-testing' + gem 'rspec_junit_formatter' gem 'codeclimate-test-reporter', require: nil end From 71d9e5cf458046f174cafa23e462e358534574ad Mon Sep 17 00:00:00 2001 From: Gabe Isman Date: Tue, 25 Sep 2018 17:50:57 -0400 Subject: [PATCH 55/59] Gemfile lock changes. --- Gemfile.lock | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Gemfile.lock b/Gemfile.lock index 596294f1..563b9aba 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -234,6 +234,8 @@ GEM rspec-mocks (~> 3.8.0) rspec-support (~> 3.8.0) rspec-support (3.8.0) + rspec_junit_formatter (0.3.0) + rspec-core (>= 2, < 4, != 2.12.0) ruby_dep (1.5.0) safe_yaml (1.0.4) sass (3.5.7) @@ -326,6 +328,7 @@ DEPENDENCIES rails-controller-testing rails_12factor rspec-rails (~> 3.8) + rspec_junit_formatter sass-rails (~> 5.0) sdoc (~> 1.0.0) simple_form (~> 4.0) From 6a952b5d1d7d2d72755919aaff2f5d124901d9d4 Mon Sep 17 00:00:00 2001 From: Gabe Isman Date: Tue, 25 Sep 2018 17:54:57 -0400 Subject: [PATCH 56/59] What happens if I just let Heroku handle deployment? --- .circleci/config.yml | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2da97a0f..db710312 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -75,25 +75,3 @@ jobs: # Save test results for reporting in the UI - store_test_results: path: test-results - - deploy: - docker: - - image: buildpack-deps:trusty - steps: - - checkout - - run: - name: Deploy to Heroku - command: | - git push https://heroku:$HEROKU_API_KEY@git.heroku.com/the-marshall-project-klaxon.git master - -workflows: - version: 2 - build-deploy: - jobs: - - build - - deploy: - requires: - - build - filters: - branches: - only: develop From 682275198db6d19c7d25d6e4cfb4f2f1e28b65cf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 26 Sep 2018 10:27:27 +0000 Subject: [PATCH 57/59] Bump bootsnap from 1.3.1 to 1.3.2 Bumps [bootsnap](https://github.com/Shopify/bootsnap) from 1.3.1 to 1.3.2. - [Release notes](https://github.com/Shopify/bootsnap/releases) - [Changelog](https://github.com/Shopify/bootsnap/blob/master/CHANGELOG.md) - [Commits](https://github.com/Shopify/bootsnap/compare/v1.3.1...v1.3.2) Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 563b9aba..6587f0e8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -58,7 +58,7 @@ GEM aws-sigv4 (1.0.3) bcrypt (3.1.12) bindex (0.5.0) - bootsnap (1.3.1) + bootsnap (1.3.2) msgpack (~> 1.0) builder (3.2.3) byebug (10.0.2) From a5cbc2ab13b4716ff3cd6ab13295a23817308172 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 26 Sep 2018 10:28:04 +0000 Subject: [PATCH 58/59] Bump rspec_junit_formatter from 0.3.0 to 0.4.1 Bumps [rspec_junit_formatter](https://github.com/sj26/rspec_junit_formatter) from 0.3.0 to 0.4.1. - [Release notes](https://github.com/sj26/rspec_junit_formatter/releases) - [Changelog](https://github.com/sj26/rspec_junit_formatter/blob/master/CHANGELOG.md) - [Commits](https://github.com/sj26/rspec_junit_formatter/compare/v0.3.0...v0.4.1) Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 563b9aba..78791408 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -234,7 +234,7 @@ GEM rspec-mocks (~> 3.8.0) rspec-support (~> 3.8.0) rspec-support (3.8.0) - rspec_junit_formatter (0.3.0) + rspec_junit_formatter (0.4.1) rspec-core (>= 2, < 4, != 2.12.0) ruby_dep (1.5.0) safe_yaml (1.0.4) From f17e242b563b39146b88fdf370cfaf5eae9f83bd Mon Sep 17 00:00:00 2001 From: Gabe Isman Date: Wed, 26 Sep 2018 10:45:00 -0400 Subject: [PATCH 59/59] Wait for db BEFORE trying to use it. --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index db710312..79559ff9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -54,6 +54,10 @@ jobs: environment: RAILS_GROUPS: assets + - run: + name: Wait for DB + command: dockerize -wait tcp://localhost:5432 -timeout 1m + - run: command: bundle exec rake db:create db:schema:load --trace environment: @@ -64,10 +68,6 @@ jobs: name: Make results directory command: mkdir -p test-results/rspec/ - - run: - name: Wait for DB - command: dockerize -wait tcp://localhost:5432 -timeout 1m - - run: name: Run the tests command: bundle exec rspec -r rspec_junit_formatter --format RspecJunitFormatter -o test-results/rspec/rspec.xml