diff --git a/Gemfile b/Gemfile index 4dc3bec30..4c36b0c74 100644 --- a/Gemfile +++ b/Gemfile @@ -9,7 +9,8 @@ gem 'rails', '~> 6.1' platforms :ruby do gem 'sass' gem 'sqlite3' - gem 'sprockets' + gem 'sprockets-rails' + gem 'sassc' group :development, :test do gem 'capybara' diff --git a/Gemfile.lock b/Gemfile.lock index dd6e47d75..6ad24f670 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -227,6 +227,8 @@ GEM sass-listen (4.0.0) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) + sassc (2.4.0) + ffi (~> 1.9) shrine (3.6.0) content_disposition (~> 1.0) down (~> 5.1) @@ -271,9 +273,10 @@ DEPENDENCIES rails (~> 6.1) rubocop-rails sass + sassc shrine shrine-mongoid - sprockets + sprockets-rails sqlite3 BUNDLED WITH diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js new file mode 100644 index 000000000..0245ca2af --- /dev/null +++ b/app/assets/config/manifest.js @@ -0,0 +1,7 @@ +//= link_tree ../images + +//= link_directory ../javascripts .js +//= link_directory ../stylesheets .css + +//= link ckeditor/application.css +//= link application.css diff --git a/lib/generators/ckeditor/templates/active_record/active_storage/migration.rb b/lib/generators/ckeditor/templates/active_record/active_storage/migration.rb index 0d27b624a..a4d905c4c 100644 --- a/lib/generators/ckeditor/templates/active_record/active_storage/migration.rb +++ b/lib/generators/ckeditor/templates/active_record/active_storage/migration.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class CreateCkeditorAssets < ActiveRecord::Migration[5.2] +class CreateCkeditorAssets < ActiveRecord::Migration[6.1] def up create_table :ckeditor_assets do |t| t.string :data_file_name, null: false diff --git a/lib/generators/ckeditor/templates/active_record/carrierwave/migration.rb b/lib/generators/ckeditor/templates/active_record/carrierwave/migration.rb index cbb307e66..c657599be 100644 --- a/lib/generators/ckeditor/templates/active_record/carrierwave/migration.rb +++ b/lib/generators/ckeditor/templates/active_record/carrierwave/migration.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class CreateCkeditorAssets < ActiveRecord::Migration[5.2] +class CreateCkeditorAssets < ActiveRecord::Migration[6.1] def up create_table :ckeditor_assets do |t| t.string :data_file_name, null: false diff --git a/lib/generators/ckeditor/templates/active_record/dragonfly/migration.rb b/lib/generators/ckeditor/templates/active_record/dragonfly/migration.rb index ca60e72ed..7c2025cd7 100644 --- a/lib/generators/ckeditor/templates/active_record/dragonfly/migration.rb +++ b/lib/generators/ckeditor/templates/active_record/dragonfly/migration.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class CreateCkeditorAssets < ActiveRecord::Migration[5.2] +class CreateCkeditorAssets < ActiveRecord::Migration[6.1] def up create_table :ckeditor_assets do |t| t.string :data_uid, null: false diff --git a/lib/generators/ckeditor/templates/active_record/paperclip/migration.rb b/lib/generators/ckeditor/templates/active_record/paperclip/migration.rb index 0d27b624a..a4d905c4c 100644 --- a/lib/generators/ckeditor/templates/active_record/paperclip/migration.rb +++ b/lib/generators/ckeditor/templates/active_record/paperclip/migration.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class CreateCkeditorAssets < ActiveRecord::Migration[5.2] +class CreateCkeditorAssets < ActiveRecord::Migration[6.1] def up create_table :ckeditor_assets do |t| t.string :data_file_name, null: false diff --git a/test/controllers/attachment_files_controller_test.rb b/test/controllers/attachment_files_controller_test.rb index ac4f8d1d3..d6a879fce 100644 --- a/test/controllers/attachment_files_controller_test.rb +++ b/test/controllers/attachment_files_controller_test.rb @@ -18,7 +18,6 @@ def teardown get :index assert_equal 200, @response.status - assert_template 'ckeditor/attachment_files/index' end test 'create action via filebrowser' do diff --git a/test/controllers/pictures_controller_test.rb b/test/controllers/pictures_controller_test.rb index b9d7ac3ef..35685dad8 100644 --- a/test/controllers/pictures_controller_test.rb +++ b/test/controllers/pictures_controller_test.rb @@ -18,7 +18,6 @@ def teardown get :index assert_equal 200, @response.status - assert_template 'ckeditor/pictures/index' end test 'create action via filebrowser' do diff --git a/test/dummy/app/assets/config/manifest.js b/test/dummy/app/assets/config/manifest.js index b16e53d6d..03c818ac1 100644 --- a/test/dummy/app/assets/config/manifest.js +++ b/test/dummy/app/assets/config/manifest.js @@ -1,3 +1,5 @@ -//= link_tree ../images //= link_directory ../javascripts .js //= link_directory ../stylesheets .css + +//= link ckeditor/application.css +//= link application.css diff --git a/test/dummy/app/assets/javascripts/application.js b/test/dummy/app/assets/javascripts/application.js index fc19b8e61..c06621454 100644 --- a/test/dummy/app/assets/javascripts/application.js +++ b/test/dummy/app/assets/javascripts/application.js @@ -4,5 +4,3 @@ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the // the compiled file. // -//= require jquery -//= require jquery_ujs diff --git a/test/dummy/config/environments/test.rb b/test/dummy/config/environments/test.rb index 0eb3baa78..1ba44f88f 100644 --- a/test/dummy/config/environments/test.rb +++ b/test/dummy/config/environments/test.rb @@ -36,4 +36,6 @@ config.active_support.deprecation = :stderr config.active_support.test_order = :sorted + + config.assets.precompile += %w( ckeditor/application.css ckeditor/application.js application.css ) end diff --git a/test/dummy/db/migrate/20110623120047_create_posts.rb b/test/dummy/db/migrate/20110623120047_create_posts.rb index 15b0eba6d..774b41807 100644 --- a/test/dummy/db/migrate/20110623120047_create_posts.rb +++ b/test/dummy/db/migrate/20110623120047_create_posts.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class CreatePosts < ActiveRecord::Migration[5.2] +class CreatePosts < ActiveRecord::Migration[6.1] def up create_table :posts do |t| t.string :title diff --git a/test/dummy/db/migrate/20170806125915_create_active_storage_tables.rb b/test/dummy/db/migrate/20170806125915_create_active_storage_tables.rb index cfaf01cd5..54dfa0d6a 100644 --- a/test/dummy/db/migrate/20170806125915_create_active_storage_tables.rb +++ b/test/dummy/db/migrate/20170806125915_create_active_storage_tables.rb @@ -1,4 +1,4 @@ -class CreateActiveStorageTables < ActiveRecord::Migration[5.2] +class CreateActiveStorageTables < ActiveRecord::Migration[6.1] def change create_table :active_storage_blobs do |t| t.string :key, null: false @@ -8,6 +8,7 @@ def change t.bigint :byte_size, null: false t.string :checksum, null: false t.datetime :created_at, null: false + t.string :service_name, null: false t.index [ :key ], unique: true end diff --git a/test/dummy/db/migrate/20240702124877_create_active_storage_variant_records.rb b/test/dummy/db/migrate/20240702124877_create_active_storage_variant_records.rb new file mode 100644 index 000000000..70185bbf4 --- /dev/null +++ b/test/dummy/db/migrate/20240702124877_create_active_storage_variant_records.rb @@ -0,0 +1,13 @@ +# This migration comes from active_storage (originally 20191206030411) +class CreateActiveStorageVariantRecords < ActiveRecord::Migration[6.1] + def up + create_table :active_storage_variant_records do |t| + t.belongs_to :blob, null: false, index: false + t.string :variation_digest, null: false + + t.index %i[ blob_id variation_digest ], name: "index_active_storage_variant_records_uniqueness", + unique: true + t.foreign_key :active_storage_blobs, column: :blob_id + end + end +end diff --git a/test/orm/active_record.rb b/test/orm/active_record.rb index dc7c09c43..2d475fb2a 100644 --- a/test/orm/active_record.rb +++ b/test/orm/active_record.rb @@ -7,5 +7,6 @@ def activerecord_below_5_2? if activerecord_below_5_2? ActiveRecord::Migrator.migrate('test/dummy/db/migrate') else - ActiveRecord::MigrationContext.new('test/dummy/db/migrate').migrate + schema_migration = ActiveRecord::Base.connection.schema_migration + ActiveRecord::MigrationContext.new('test/dummy/db/migrate', schema_migration).migrate end diff --git a/test/test_helper.rb b/test/test_helper.rb index 83f89afa5..0d36c6c00 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -11,7 +11,6 @@ require File.expand_path('../dummy/config/environment.rb', __FILE__) require 'rails/test_help' -require 'redgreen' Rails.backtrace_cleaner.remove_silencers!