From 67a9a86b1d69367a3270240dad43bc9825ca80a5 Mon Sep 17 00:00:00 2001 From: bogdanvlviv Date: Sat, 5 Jan 2019 11:18:02 +0200 Subject: Test actiontext on Rails 6.0 - config.load_defaults 6.0 in the dummy app and fix the test since by default rails 6.0 configured does not generate "utf8" hidden input, see #32125 - Use `ActiveRecord::Migration[6.0]` in the dummy app since actiontext will be since Rails 6.0 - Fix `CreateActiveStorageTables` migration in the dummy app. Add `t.foreign_key :active_storage_blobs, column: :blob_id` It was added in 2ae3a29508e. - `rails/actiontext$ yarn install` --- actiontext/test/dummy/config/application.rb | 2 +- actiontext/test/dummy/db/migrate/20180208205311_create_messages.rb | 2 +- .../dummy/db/migrate/20180212164506_create_active_storage_tables.rb | 1 + actiontext/test/dummy/db/migrate/20181003185713_create_people.rb | 2 +- actiontext/test/template/form_helper_test.rb | 4 ---- 5 files changed, 4 insertions(+), 7 deletions(-) (limited to 'actiontext/test') diff --git a/actiontext/test/dummy/config/application.rb b/actiontext/test/dummy/config/application.rb index ddee05a4db..79eeb6ba0e 100644 --- a/actiontext/test/dummy/config/application.rb +++ b/actiontext/test/dummy/config/application.rb @@ -8,7 +8,7 @@ require "action_text" module Dummy class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 5.2 + config.load_defaults 6.0 # Settings in config/environments/* take precedence over those specified here. # Application configuration can go into files in config/initializers diff --git a/actiontext/test/dummy/db/migrate/20180208205311_create_messages.rb b/actiontext/test/dummy/db/migrate/20180208205311_create_messages.rb index 8e43559672..3552840824 100644 --- a/actiontext/test/dummy/db/migrate/20180208205311_create_messages.rb +++ b/actiontext/test/dummy/db/migrate/20180208205311_create_messages.rb @@ -1,4 +1,4 @@ -class CreateMessages < ActiveRecord::Migration[5.2] +class CreateMessages < ActiveRecord::Migration[6.0] def change create_table :messages do |t| t.string :subject diff --git a/actiontext/test/dummy/db/migrate/20180212164506_create_active_storage_tables.rb b/actiontext/test/dummy/db/migrate/20180212164506_create_active_storage_tables.rb index 360e0d1b7a..0b2ce257c8 100644 --- a/actiontext/test/dummy/db/migrate/20180212164506_create_active_storage_tables.rb +++ b/actiontext/test/dummy/db/migrate/20180212164506_create_active_storage_tables.rb @@ -21,6 +21,7 @@ class CreateActiveStorageTables < ActiveRecord::Migration[5.2] t.datetime :created_at, null: false t.index [ :record_type, :record_id, :name, :blob_id ], name: "index_active_storage_attachments_uniqueness", unique: true + t.foreign_key :active_storage_blobs, column: :blob_id end end end diff --git a/actiontext/test/dummy/db/migrate/20181003185713_create_people.rb b/actiontext/test/dummy/db/migrate/20181003185713_create_people.rb index 1d5922d389..6928a8e20d 100644 --- a/actiontext/test/dummy/db/migrate/20181003185713_create_people.rb +++ b/actiontext/test/dummy/db/migrate/20181003185713_create_people.rb @@ -1,4 +1,4 @@ -class CreatePeople < ActiveRecord::Migration[5.2] +class CreatePeople < ActiveRecord::Migration[6.0] def change create_table :people do |t| t.string :name diff --git a/actiontext/test/template/form_helper_test.rb b/actiontext/test/template/form_helper_test.rb index 63ef7f0d7e..a8c7a4dae2 100644 --- a/actiontext/test/template/form_helper_test.rb +++ b/actiontext/test/template/form_helper_test.rb @@ -12,7 +12,6 @@ class ActionText::FormHelperTest < ActionView::TestCase assert_dom_equal \ '
' \ - '' \ '' \ '' \ "" \ @@ -27,7 +26,6 @@ class ActionText::FormHelperTest < ActionView::TestCase assert_dom_equal \ '' \ - '' \ '' \ '' \ "" \ @@ -42,7 +40,6 @@ class ActionText::FormHelperTest < ActionView::TestCase assert_dom_equal \ '' \ - '' \ '' \ '' \ "" \ @@ -57,7 +54,6 @@ class ActionText::FormHelperTest < ActionView::TestCase assert_dom_equal \ '' \ - '' \ '' \ '' \ "" \ -- cgit v1.2.3