Commit 6a2b689

mo khan <mo@mokhan.ca>
2019-08-17 20:05:56
upgrade to rails 6
1 parent 326b157
config/environments/test.rb
@@ -8,7 +8,7 @@ Rails.application.configure do
   # test suite. You never need to work with it otherwise. Remember that
   # your test database is "scratch space" for the test suite and is wiped
   # and recreated between test runs. Don't rely on the data there!
-  config.cache_classes = true
+  config.cache_classes = false
 
   # Do not eager load code on boot. This avoids loading your whole application
   # just for the purpose of running a single test. If you are using a tool that
config/application.rb
@@ -19,7 +19,8 @@ Bundler.require(*Rails.groups)
 module Proof
   class Application < Rails::Application
     # Initialize configuration defaults for originally generated Rails version.
-    config.load_defaults 5.2
+    config.load_defaults "6.0"
+    config.autoloader = :classic
 
     # Settings in config/environments/* take precedence over those specified
     # here.
spec/requests/oauth/clients_spec.rb
@@ -24,7 +24,7 @@ RSpec.describe "/oauth/clients" do
 
       specify { expect(response).to have_http_status(:created) }
       specify { expect(response.headers['Set-Cookie']).to be_nil }
-      specify { expect(response.content_type).to eql("application/json") }
+      specify { expect(response.content_type).to start_with("application/json") }
       specify { expect(response.headers['Cache-Control']).to include("no-store") }
       specify { expect(response.headers['Pragma']).to eql("no-cache") }
       specify { expect(json[:client_id]).to eql(last_client.to_param) }
@@ -82,7 +82,7 @@ RSpec.describe "/oauth/clients" do
       before { get "/oauth/clients/#{client.to_param}", headers: headers }
 
       specify { expect(response).to have_http_status(:ok) }
-      specify { expect(response.content_type).to eql('application/json') }
+      specify { expect(response.content_type).to start_with('application/json') }
       specify { expect(response.headers['Set-Cookie']).to be_nil }
       specify { expect(json[:client_id]).to eql(client.to_param) }
       pending { expect(json[:client_secret]).to eql(client.password) }
@@ -152,7 +152,7 @@ RSpec.describe "/oauth/clients" do
         before { put "/oauth/clients/#{client.to_param}", params: request_body, headers: headers }
 
         specify { expect(response).to have_http_status(:ok) }
-        specify { expect(response.content_type).to eql('application/json') }
+        specify { expect(response.content_type).to start_with('application/json') }
         specify { expect(json[:client_id]).to eql(client.to_param) }
         pending { expect(json[:client_secret]).to eql(client.password) }
         specify { expect(json[:client_id_issued_at]).to eql(client.created_at.to_i) }
@@ -185,7 +185,7 @@ RSpec.describe "/oauth/clients" do
         before { put "/oauth/clients/#{client.to_param}", params: request_body, headers: headers }
 
         specify { expect(response).to have_http_status(:bad_request) }
-        specify { expect(response.content_type).to eql('application/json') }
+        specify { expect(response.content_type).to start_with('application/json') }
         specify { expect(json[:error]).to eql("invalid_client_metadata") }
         specify { expect(json[:error_description]).to eql("Name can't be blank") }
       end
spec/requests/well-known/oauth_spec.rb
@@ -9,7 +9,7 @@ RSpec.describe "/.well-known/oauth-authorization-server" do
     before { get "/.well-known/oauth-authorization-server" }
 
     specify { expect(response).to have_http_status(:ok) }
-    specify { expect(response.content_type).to eql("application/json") }
+    specify { expect(response.content_type).to start_with("application/json") }
     specify { expect(response.headers['Set-Cookie']).to be_nil }
     specify { expect(json[:issuer]).to eql(root_url) }
     specify { expect(json[:authorization_endpoint]).to eql(oauth_authorizations_url) }
spec/requests/metadata_spec.rb
@@ -9,6 +9,6 @@ describe '/metadata' do
     specify { expect(Saml::Kit::Metadata.from(response.body)).to be_valid }
     specify { expect(Saml::Kit::Metadata.from(response.body).entity_id).to eql(Saml::Kit.configuration.entity_id) }
     specify { expect(response).to have_http_status(:ok) }
-    specify { expect(response.content_type).to eq("application/samlmetadata+xml") }
+    specify { expect(response.content_type).to start_with("application/samlmetadata+xml;") }
   end
 end
Gemfile
@@ -7,19 +7,19 @@ ruby '2.6.3'
 gem 'activerecord-session_store', '~> 1.1'
 gem 'audited', '~> 4.8'
 gem 'bcrypt', '~> 3.1'
-gem 'bootsnap', '>= 1.1.0', require: false
+gem 'bootsnap', '>= 1.4.4', require: false
 gem 'browser', '~> 2.5'
 gem 'dotenv', '~> 2.5'
 gem 'email_validator', '~> 1.6'
 gem 'flipper', '~> 0.16'
-gem 'flipper-active_record', '~> 0.16'
+gem 'flipper-active_record', '~> 0.16', github: 'mokhan/flipper'
 gem 'flutie', '~> 2.1'
 gem 'jbuilder', '~> 2.5'
 gem 'jwt', '~> 2.1'
 gem 'local_time', '~> 2.1'
 gem 'pg'
 gem 'puma', '~> 3.11'
-gem 'rails', '~> 5.2.0'
+gem 'rails', '~> 6.0.0'
 gem 'rotp', '~> 3.3'
 gem 'saml-kit', '~> 1.0'
 gem 'scim-kit', '~> 0.4'
Gemfile.lock
@@ -1,56 +1,78 @@
+GIT
+  remote: https://github.com/mokhan/flipper.git
+  revision: 171457dd3d3fdc469b568f01f171609a2d89c53f
+  specs:
+    flipper (0.16.2)
+    flipper-active_record (0.16.2)
+      activerecord (>= 3.2, < 7)
+      flipper (~> 0.16.2)
+
 GEM
   remote: https://rubygems.org/
   specs:
-    actioncable (5.2.3)
-      actionpack (= 5.2.3)
+    actioncable (6.0.0)
+      actionpack (= 6.0.0)
       nio4r (~> 2.0)
       websocket-driver (>= 0.6.1)
-    actionmailer (5.2.3)
-      actionpack (= 5.2.3)
-      actionview (= 5.2.3)
-      activejob (= 5.2.3)
+    actionmailbox (6.0.0)
+      actionpack (= 6.0.0)
+      activejob (= 6.0.0)
+      activerecord (= 6.0.0)
+      activestorage (= 6.0.0)
+      activesupport (= 6.0.0)
+      mail (>= 2.7.1)
+    actionmailer (6.0.0)
+      actionpack (= 6.0.0)
+      actionview (= 6.0.0)
+      activejob (= 6.0.0)
       mail (~> 2.5, >= 2.5.4)
       rails-dom-testing (~> 2.0)
-    actionpack (5.2.3)
-      actionview (= 5.2.3)
-      activesupport (= 5.2.3)
+    actionpack (6.0.0)
+      actionview (= 6.0.0)
+      activesupport (= 6.0.0)
       rack (~> 2.0)
       rack-test (>= 0.6.3)
       rails-dom-testing (~> 2.0)
-      rails-html-sanitizer (~> 1.0, >= 1.0.2)
-    actionview (5.2.3)
-      activesupport (= 5.2.3)
+      rails-html-sanitizer (~> 1.0, >= 1.2.0)
+    actiontext (6.0.0)
+      actionpack (= 6.0.0)
+      activerecord (= 6.0.0)
+      activestorage (= 6.0.0)
+      activesupport (= 6.0.0)
+      nokogiri (>= 1.8.5)
+    actionview (6.0.0)
+      activesupport (= 6.0.0)
       builder (~> 3.1)
       erubi (~> 1.4)
       rails-dom-testing (~> 2.0)
-      rails-html-sanitizer (~> 1.0, >= 1.0.3)
-    activejob (5.2.3)
-      activesupport (= 5.2.3)
+      rails-html-sanitizer (~> 1.1, >= 1.2.0)
+    activejob (6.0.0)
+      activesupport (= 6.0.0)
       globalid (>= 0.3.6)
-    activemodel (5.2.3)
-      activesupport (= 5.2.3)
-    activerecord (5.2.3)
-      activemodel (= 5.2.3)
-      activesupport (= 5.2.3)
-      arel (>= 9.0)
+    activemodel (6.0.0)
+      activesupport (= 6.0.0)
+    activerecord (6.0.0)
+      activemodel (= 6.0.0)
+      activesupport (= 6.0.0)
     activerecord-session_store (1.1.3)
       actionpack (>= 4.0)
       activerecord (>= 4.0)
       multi_json (~> 1.11, >= 1.11.2)
       rack (>= 1.5.2, < 3)
       railties (>= 4.0)
-    activestorage (5.2.3)
-      actionpack (= 5.2.3)
-      activerecord (= 5.2.3)
+    activestorage (6.0.0)
+      actionpack (= 6.0.0)
+      activejob (= 6.0.0)
+      activerecord (= 6.0.0)
       marcel (~> 0.3.1)
-    activesupport (5.2.3)
+    activesupport (6.0.0)
       concurrent-ruby (~> 1.0, >= 1.0.2)
       i18n (>= 0.7, < 2)
       minitest (~> 5.1)
       tzinfo (~> 1.1)
+      zeitwerk (~> 2.1, >= 2.1.8)
     addressable (2.6.0)
       public_suffix (>= 2.0.2, < 4.0)
-    arel (9.0.0)
     ast (2.4.0)
     audited (4.9.0)
       activerecord (>= 4.2, < 6.1)
@@ -114,10 +136,6 @@ GEM
       railties (>= 3.0.0)
     ffaker (2.11.0)
     ffi (1.11.1)
-    flipper (0.16.2)
-    flipper-active_record (0.16.2)
-      activerecord (>= 3.2, < 6)
-      flipper (~> 0.16.2)
     flutie (2.1.0)
     forwardable-extended (2.6.0)
     globalid (0.4.2)
@@ -209,38 +227,40 @@ GEM
       rack
     rack-test (1.1.0)
       rack (>= 1.0, < 3)
-    rails (5.2.3)
-      actioncable (= 5.2.3)
-      actionmailer (= 5.2.3)
-      actionpack (= 5.2.3)
-      actionview (= 5.2.3)
-      activejob (= 5.2.3)
-      activemodel (= 5.2.3)
-      activerecord (= 5.2.3)
-      activestorage (= 5.2.3)
-      activesupport (= 5.2.3)
+    rails (6.0.0)
+      actioncable (= 6.0.0)
+      actionmailbox (= 6.0.0)
+      actionmailer (= 6.0.0)
+      actionpack (= 6.0.0)
+      actiontext (= 6.0.0)
+      actionview (= 6.0.0)
+      activejob (= 6.0.0)
+      activemodel (= 6.0.0)
+      activerecord (= 6.0.0)
+      activestorage (= 6.0.0)
+      activesupport (= 6.0.0)
       bundler (>= 1.3.0)
-      railties (= 5.2.3)
+      railties (= 6.0.0)
       sprockets-rails (>= 2.0.0)
     rails-dom-testing (2.0.3)
       activesupport (>= 4.2.0)
       nokogiri (>= 1.6)
     rails-html-sanitizer (1.2.0)
       loofah (~> 2.2, >= 2.2.2)
-    rails-i18n (5.1.3)
+    rails-i18n (6.0.0)
       i18n (>= 0.7, < 2)
-      railties (>= 5.0, < 6)
+      railties (>= 6.0.0, < 7)
     rails_12factor (0.0.3)
       rails_serve_static_assets
       rails_stdout_logging
     rails_serve_static_assets (0.0.5)
     rails_stdout_logging (0.0.5)
-    railties (5.2.3)
-      actionpack (= 5.2.3)
-      activesupport (= 5.2.3)
+    railties (6.0.0)
+      actionpack (= 6.0.0)
+      activesupport (= 6.0.0)
       method_source
       rake (>= 0.8.7)
-      thor (>= 0.19.0, < 2.0)
+      thor (>= 0.20.3, < 2.0)
     rainbow (3.0.0)
     rake (12.3.3)
     rb-fsevent (0.10.3)
@@ -325,11 +345,11 @@ GEM
     unicode-display_width (1.6.0)
     varkon (0.1.0)
     vcr (4.0.0)
-    web-console (3.7.0)
-      actionview (>= 5.0)
-      activemodel (>= 5.0)
+    web-console (4.0.1)
+      actionview (>= 6.0.0)
+      activemodel (>= 6.0.0)
       bindex (>= 0.4.0)
-      railties (>= 5.0)
+      railties (>= 6.0.0)
     webmock (3.6.2)
       addressable (>= 2.3.6)
       crack (>= 0.3.2)
@@ -351,6 +371,7 @@ GEM
       nokogiri (>= 1.6.8, < 2.0.0)
     xpath (3.2.0)
       nokogiri (~> 1.8)
+    zeitwerk (2.1.9)
 
 PLATFORMS
   ruby
@@ -359,7 +380,7 @@ DEPENDENCIES
   activerecord-session_store (~> 1.1)
   audited (~> 4.8)
   bcrypt (~> 3.1)
-  bootsnap (>= 1.1.0)
+  bootsnap (>= 1.4.4)
   brakeman (~> 4.3)
   browser (~> 2.5)
   bundler-audit (~> 0.6)
@@ -372,7 +393,7 @@ DEPENDENCIES
   factory_bot_rails (~> 4.11)
   ffaker (~> 2.10)
   flipper (~> 0.16)
-  flipper-active_record (~> 0.16)
+  flipper-active_record (~> 0.16)!
   flutie (~> 2.1)
   i18n-tasks (~> 0.9.24)
   jbuilder (~> 2.5)
@@ -383,7 +404,7 @@ DEPENDENCIES
   minima (~> 2.0)
   pg
   puma (~> 3.11)
-  rails (~> 5.2.0)
+  rails (~> 6.0.0)
   rails_12factor (~> 0.0)
   rotp (~> 3.3)
   rspec-rails (~> 3.8)