Bump rails to 7 and get tests passing. Also modified rakefile so rake

command would continue to run rspec as the default command.  Added
stylesheets to assets.rb so they'll be included when precompiling
assets in production.
This commit is contained in:
Nelson Jovel 2022-01-15 12:43:01 +01:00 committed by rebuilt
parent 24f22d3c46
commit b111b2f106
16 changed files with 113 additions and 93 deletions

View file

@ -7,13 +7,15 @@ git_source(:github) do |repo_name|
end
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.1.4.4'
gem 'rails', '~> 7.0.1'
gem 'sprockets-rails'
gem 'pg'
# Use Puma as the app server
gem 'puma', '>= 5.5.2'
# Use SCSS for stylesheets
gem 'sassc-rails', require: false
# gem 'sassc-rails', require: false
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
@ -70,7 +72,6 @@ group :development do
gem 'rubocop', require: false
gem 'seed_dump'
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end
group 'test' do

View file

@ -10,74 +10,80 @@ GIT
GEM
remote: https://rubygems.org/
specs:
actioncable (6.1.4.4)
actionpack (= 6.1.4.4)
activesupport (= 6.1.4.4)
actioncable (7.0.1)
actionpack (= 7.0.1)
activesupport (= 7.0.1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.1.4.4)
actionpack (= 6.1.4.4)
activejob (= 6.1.4.4)
activerecord (= 6.1.4.4)
activestorage (= 6.1.4.4)
activesupport (= 6.1.4.4)
actionmailbox (7.0.1)
actionpack (= 7.0.1)
activejob (= 7.0.1)
activerecord (= 7.0.1)
activestorage (= 7.0.1)
activesupport (= 7.0.1)
mail (>= 2.7.1)
actionmailer (6.1.4.4)
actionpack (= 6.1.4.4)
actionview (= 6.1.4.4)
activejob (= 6.1.4.4)
activesupport (= 6.1.4.4)
net-imap
net-pop
net-smtp
actionmailer (7.0.1)
actionpack (= 7.0.1)
actionview (= 7.0.1)
activejob (= 7.0.1)
activesupport (= 7.0.1)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.0)
actionpack (6.1.4.4)
actionview (= 6.1.4.4)
activesupport (= 6.1.4.4)
rack (~> 2.0, >= 2.0.9)
actionpack (7.0.1)
actionview (= 7.0.1)
activesupport (= 7.0.1)
rack (~> 2.0, >= 2.2.0)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (6.1.4.4)
actionpack (= 6.1.4.4)
activerecord (= 6.1.4.4)
activestorage (= 6.1.4.4)
activesupport (= 6.1.4.4)
actiontext (7.0.1)
actionpack (= 7.0.1)
activerecord (= 7.0.1)
activestorage (= 7.0.1)
activesupport (= 7.0.1)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (6.1.4.4)
activesupport (= 6.1.4.4)
actionview (7.0.1)
activesupport (= 7.0.1)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (6.1.4.4)
activesupport (= 6.1.4.4)
activejob (7.0.1)
activesupport (= 7.0.1)
globalid (>= 0.3.6)
activemodel (6.1.4.4)
activesupport (= 6.1.4.4)
activerecord (6.1.4.4)
activemodel (= 6.1.4.4)
activesupport (= 6.1.4.4)
activemodel (7.0.1)
activesupport (= 7.0.1)
activerecord (7.0.1)
activemodel (= 7.0.1)
activesupport (= 7.0.1)
activerecord-import (1.3.0)
activerecord (>= 4.2)
activestorage (6.1.4.4)
actionpack (= 6.1.4.4)
activejob (= 6.1.4.4)
activerecord (= 6.1.4.4)
activesupport (= 6.1.4.4)
marcel (~> 1.0.0)
activestorage (7.0.1)
actionpack (= 7.0.1)
activejob (= 7.0.1)
activerecord (= 7.0.1)
activesupport (= 7.0.1)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (6.1.4.4)
activesupport (7.0.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
ast (2.4.2)
bcrypt (3.1.16)
bindex (0.8.1)
bootsnap (1.10.1)
msgpack (~> 1.2)
bootsnap (1.9.4)
msgpack (~> 1.0)
builder (3.2.4)
bullet (7.0.1)
activesupport (>= 3.0.0)
@ -109,6 +115,7 @@ GEM
responders
warden (~> 1.2.3)
diff-lcs (1.5.0)
digest (3.1.0)
erubi (1.10.0)
execjs (2.8.1)
factory_bot (6.2.0)
@ -127,6 +134,7 @@ GEM
hashie (5.0.0)
i18n (1.8.11)
concurrent-ruby (~> 1.0)
io-wait (0.2.1)
jbuilder (2.11.5)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
@ -155,6 +163,21 @@ GEM
msgpack (1.4.2)
multi_json (1.15.0)
nested_scaffold (1.1.0)
net-imap (0.2.3)
digest
net-protocol
strscan
net-pop (0.1.1)
digest
net-protocol
timeout
net-protocol (0.1.2)
io-wait
timeout
net-smtp (0.3.1)
digest
net-protocol
timeout
newrelic_rpm (8.3.0)
nio4r (2.5.8)
nokogiri (1.13.1-x86_64-darwin)
@ -179,21 +202,20 @@ GEM
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (6.1.4.4)
actioncable (= 6.1.4.4)
actionmailbox (= 6.1.4.4)
actionmailer (= 6.1.4.4)
actionpack (= 6.1.4.4)
actiontext (= 6.1.4.4)
actionview (= 6.1.4.4)
activejob (= 6.1.4.4)
activemodel (= 6.1.4.4)
activerecord (= 6.1.4.4)
activestorage (= 6.1.4.4)
activesupport (= 6.1.4.4)
rails (7.0.1)
actioncable (= 7.0.1)
actionmailbox (= 7.0.1)
actionmailer (= 7.0.1)
actionpack (= 7.0.1)
actiontext (= 7.0.1)
actionview (= 7.0.1)
activejob (= 7.0.1)
activemodel (= 7.0.1)
activerecord (= 7.0.1)
activestorage (= 7.0.1)
activesupport (= 7.0.1)
bundler (>= 1.15.0)
railties (= 6.1.4.4)
sprockets-rails (>= 2.0.0)
railties (= 7.0.1)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
actionview (>= 5.0.1.rc1)
@ -203,12 +225,13 @@ GEM
nokogiri (>= 1.6)
rails-html-sanitizer (1.4.2)
loofah (~> 2.3)
railties (6.1.4.4)
actionpack (= 6.1.4.4)
activesupport (= 6.1.4.4)
railties (7.0.1)
actionpack (= 7.0.1)
activesupport (= 7.0.1)
method_source
rake (>= 0.13)
rake (>= 12.2)
thor (~> 1.0)
zeitwerk (~> 2.5)
rainbow (3.1.1)
rake (13.0.6)
rb-fsevent (0.11.0)
@ -248,21 +271,10 @@ GEM
rubocop-ast (1.15.1)
parser (>= 3.0.1.1)
ruby-progressbar (1.11.0)
sassc (2.4.0)
ffi (~> 1.9)
sassc-rails (2.1.2)
railties (>= 4.0.0)
sassc (>= 2.0)
sprockets (> 3.0)
sprockets-rails
tilt
seed_dump (3.3.1)
activerecord (>= 4)
activesupport (>= 4)
spring (2.1.1)
spring-watcher-listen (2.0.1)
listen (>= 2.7, < 4.0)
spring (>= 1.2, < 3.0)
spring (4.0.0)
sprockets (4.0.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
@ -270,10 +282,12 @@ GEM
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
strscan (3.0.1)
temple (0.8.2)
thor (1.2.1)
tilt (2.0.10)
timecop (0.9.4)
timeout (0.2.0)
turbolinks (5.2.1)
turbolinks-source (~> 5.2)
turbolinks-source (5.2.0)
@ -329,14 +343,13 @@ DEPENDENCIES
omniauth
pg
puma (>= 5.5.2)
rails (~> 6.1.4.4)
rails (~> 7.0.1)
rails-controller-testing
rspec-rails (~> 4.1.2)
rubocop
sassc-rails
seed_dump
spring
spring-watcher-listen (~> 2.0.0)
sprockets-rails
timecop
turbolinks (~> 5)
twilio-ruby (~> 4.11.1)

View file

@ -2,5 +2,14 @@
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require_relative 'config/application'
Rails.application.load_tasks
begin
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)
# task(:default).clear
task default: :spec
rescue LoadError => e
raise e unless ENV['RAILS_ENV'] == 'production'
end

View file

@ -1,6 +1,3 @@
//= link_tree ../images
//= link_directory ../javascripts .js
//= link sqm_application.css
//= link application.css
//= link welcome.css
//= link_tree ../builds
//= link_directory ../javascripts .js

View file

@ -46,7 +46,6 @@
// Utilities
@import "bootstrap/scss/utilities/api";
.popover {
box-shadow: 0 0 8px rgba($black, 0.25);
}

View file

@ -1,6 +1,6 @@
@import "partials/colors";
@import "partials/sqm_bootstrap";
@import "partials/bootstrap-overrides";
@import "partials/sqm_bootstrap";
@import "partials/clear-margin-padding";
@import "partials/fonts";
@import "partials/borders";

View file

@ -7,7 +7,7 @@
<link href="https://fonts.googleapis.com/css?family=Cabin:400,600,700" rel="stylesheet" type="text/css"/>
<title>MCIEA</title>
<%= csp_meta_tag %>
<%= stylesheet_link_tag 'sqm_application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= stylesheet_link_tag 'sqm', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
<%= render partial: 'layouts/google_analytics', locals: { google_analytics_id: @google_analytics_id } %>
<%= render partial: 'layouts/hotjar', locals: { hotjar_id: @hotjar_id } %>

View file

@ -3,7 +3,7 @@
<title>MCIEA</title>
<link href="https://fonts.googleapis.com/css?family=Bitter:400,600,700" rel="stylesheet" type="text/css"/>
<link href="https://fonts.googleapis.com/css?family=Cabin:400,600,700" rel="stylesheet" type="text/css"/>
<%= stylesheet_link_tag 'sqm_application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= stylesheet_link_tag 'sqm', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= stylesheet_link_tag 'welcome', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
<%= render partial: 'layouts/google_analytics', locals: { google_analytics_id: @google_analytics_id } %>

View file

@ -11,5 +11,6 @@ module Edcontext
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
config.active_record.legacy_connection_handling = false
end
end

View file

@ -9,4 +9,4 @@ Rails.application.config.assets.version = '1.0'
# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in the app/assets
# folder are already added.
# Rails.application.config.assets.precompile += %w( admin.js admin.css )
Rails.application.config.assets.precompile += %w( application.css sqm.css welcome.css)

View file

@ -18,8 +18,8 @@
"scripts": {
"build": "esbuild app/javascript/*.* --bundle --outdir=app/assets/builds",
"test": "jest",
"build:css": "sass ./app/assets/stylesheets/application.scss ./app/assets/builds/application.css --no-source-map --load-path=node_modules & sass ./app/assets/stylesheets/sqm_application.scss ./app/assets/builds/sqm_application.css --no-source-map --load-path=node_modules & sass ./app/assets/stylesheets/welcome.scss ./app/assets/builds/welcome.css --no-source-map --load-path=node_modules",
"watch:css": "sass ./app/assets/stylesheets/application.scss ./app/assets/builds/application.css --no-source-map --load-path=node_modules --watch & sass ./app/assets/stylesheets/sqm_application.scss ./app/assets/builds/sqm_application.css --no-source-map --load-path=node_modules --watch & sass ./app/assets/stylesheets/welcome.scss ./app/assets/builds/welcome.css --no-source-map --load-path=node_modules --watch",
"build:css": "sass ./app/assets/stylesheets/application.sass.scss ./app/assets/builds/application.css --no-source-map --load-path=node_modules ; sass ./app/assets/stylesheets/sqm.sass.scss ./app/assets/builds/sqm.css --no-source-map --load-path=node_modules ; sass ./app/assets/stylesheets/welcome.sass.scss ./app/assets/builds/welcome.css --no-source-map --load-path=node_modules",
"watch:css": "sass ./app/assets/stylesheets/application.sass.scss ./app/assets/builds/application.css --no-source-map --load-path=node_modules --watch & sass ./app/assets/stylesheets/sqm.sass.scss ./app/assets/builds/sqm.css --no-source-map --load-path=node_modules --watch & sass ./app/assets/stylesheets/welcome.sass.scss ./app/assets/builds/welcome.css --no-source-map --load-path=node_modules --watch",
"watch:all": "yarn watch:css & yarn build --watch"
},
"devDependencies": {

View file

@ -1,6 +1,6 @@
require 'rails_helper'
describe 'categories/show.html.erb' do
describe 'categories/show' do
before :each do
academic_year = create(:academic_year, range: '1989-90')
school = create(:school, name: 'Best School')

View file

@ -1,6 +1,6 @@
require 'rails_helper'
describe 'home/index.html.erb' do
describe 'home/index' do
subject { Nokogiri::HTML(rendered) }
before :each do

View file

@ -1,6 +1,6 @@
require 'rails_helper'
describe 'overview/index.html.erb' do
describe 'overview/index' do
subject { Nokogiri::HTML(rendered) }
let(:support_for_teaching) do