From 6e1a13d1252bed7a06dce4402d987236a71e981c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Mon, 11 Sep 2023 18:38:53 +0000 Subject: [PATCH] Make sure tests work with Rails 7 --- .gitignore | 1 - Gemfile | 4 + Gemfile.lock | 243 ++++++++++++++++++ .../legacy_pages_controller_test.rb | 2 +- test/controller/pages_controller_test.rb | 2 +- test/example/config/application.rb | 1 + 6 files changed, 250 insertions(+), 3 deletions(-) create mode 100644 Gemfile.lock diff --git a/.gitignore b/.gitignore index 26ff6bad..9349b8db 100644 --- a/.gitignore +++ b/.gitignore @@ -12,7 +12,6 @@ lib/turbomodules.js *.gem *.orig .all -Gemfile.lock .ruby-version .*.swp .DS_Store diff --git a/Gemfile b/Gemfile index fa75df15..239879aa 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,7 @@ source 'https://rubygems.org' gemspec + +gem "sprockets", "< 4" +gem "sprockets-rails" +gem "puma" diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 00000000..f2209a86 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,243 @@ +PATH + remote: . + specs: + turbograft (0.4.8) + coffee-rails + +GEM + remote: https://rubygems.org/ + specs: + actioncable (7.0.8) + actionpack (= 7.0.8) + activesupport (= 7.0.8) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailbox (7.0.8) + actionpack (= 7.0.8) + activejob (= 7.0.8) + activerecord (= 7.0.8) + activestorage (= 7.0.8) + activesupport (= 7.0.8) + mail (>= 2.7.1) + net-imap + net-pop + net-smtp + actionmailer (7.0.8) + actionpack (= 7.0.8) + actionview (= 7.0.8) + activejob (= 7.0.8) + activesupport (= 7.0.8) + mail (~> 2.5, >= 2.5.4) + net-imap + net-pop + net-smtp + rails-dom-testing (~> 2.0) + actionpack (7.0.8) + actionview (= 7.0.8) + activesupport (= 7.0.8) + rack (~> 2.0, >= 2.2.4) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actiontext (7.0.8) + actionpack (= 7.0.8) + activerecord (= 7.0.8) + activestorage (= 7.0.8) + activesupport (= 7.0.8) + globalid (>= 0.6.0) + nokogiri (>= 1.8.5) + actionview (7.0.8) + activesupport (= 7.0.8) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + activejob (7.0.8) + activesupport (= 7.0.8) + globalid (>= 0.3.6) + activemodel (7.0.8) + activesupport (= 7.0.8) + activerecord (7.0.8) + activemodel (= 7.0.8) + activesupport (= 7.0.8) + activestorage (7.0.8) + actionpack (= 7.0.8) + activejob (= 7.0.8) + activerecord (= 7.0.8) + activesupport (= 7.0.8) + marcel (~> 1.0) + mini_mime (>= 1.1.0) + activesupport (7.0.8) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + addressable (2.8.5) + public_suffix (>= 2.0.2, < 6.0) + ansi (1.5.0) + builder (3.2.4) + byebug (11.1.3) + capybara (3.39.2) + addressable + matrix + mini_mime (>= 0.1.3) + nokogiri (~> 1.8) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + regexp_parser (>= 1.5, < 3.0) + xpath (~> 3.2) + coderay (1.1.3) + coffee-rails (5.0.0) + coffee-script (>= 2.2.0) + railties (>= 5.2.0) + coffee-script (2.4.1) + coffee-script-source + execjs + coffee-script-source (1.12.2) + concurrent-ruby (1.2.2) + crass (1.0.6) + daemons (1.4.1) + date (3.3.3) + erubi (1.12.0) + eventmachine (1.2.7) + execjs (2.9.0) + globalid (1.2.1) + activesupport (>= 6.1) + i18n (1.14.1) + concurrent-ruby (~> 1.0) + jquery-rails (4.6.0) + rails-dom-testing (>= 1, < 3) + railties (>= 4.2.0) + thor (>= 0.14, < 2.0) + loofah (2.21.3) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + mail (2.8.1) + mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp + marcel (1.0.2) + matrix (0.4.2) + method_source (1.0.0) + mini_mime (1.1.5) + minitest (5.20.0) + minitest-reporters (1.6.1) + ansi + builder + minitest (>= 5.0) + ruby-progressbar + net-imap (0.3.7) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.1) + timeout + net-smtp (0.3.3) + net-protocol + nio4r (2.5.9) + nokogiri (1.15.4-x86_64-linux) + racc (~> 1.4) + pry (0.14.2) + coderay (~> 1.1) + method_source (~> 1.0) + pry-byebug (3.10.1) + byebug (~> 11.0) + pry (>= 0.13, < 0.15) + public_suffix (5.0.3) + puma (6.3.1) + nio4r (~> 2.0) + racc (1.7.1) + rack (2.2.8) + rack-test (2.1.0) + rack (>= 1.3) + rails (7.0.8) + actioncable (= 7.0.8) + actionmailbox (= 7.0.8) + actionmailer (= 7.0.8) + actionpack (= 7.0.8) + actiontext (= 7.0.8) + actionview (= 7.0.8) + activejob (= 7.0.8) + activemodel (= 7.0.8) + activerecord (= 7.0.8) + activestorage (= 7.0.8) + activesupport (= 7.0.8) + bundler (>= 1.15.0) + railties (= 7.0.8) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest + nokogiri (>= 1.6) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) + railties (7.0.8) + actionpack (= 7.0.8) + activesupport (= 7.0.8) + method_source + rake (>= 12.2) + thor (~> 1.0) + zeitwerk (~> 2.5) + rake (13.0.6) + regexp_parser (2.8.1) + rexml (3.2.6) + ruby-progressbar (1.13.0) + rubyzip (2.3.2) + selenium-webdriver (4.12.0) + rexml (~> 3.2, >= 3.2.5) + rubyzip (>= 1.2.2, < 3.0) + websocket (~> 1.0) + sprockets (3.7.2) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.4.2) + actionpack (>= 5.2) + activesupport (>= 5.2) + sprockets (>= 3.0.0) + sqlite3 (1.6.5-x86_64-linux) + teaspoon (1.4.0) + railties (>= 5.0) + teaspoon-mocha (2.3.3) + teaspoon (>= 1.0.0) + thin (1.8.2) + daemons (~> 1.0, >= 1.0.9) + eventmachine (~> 1.0, >= 1.0.4) + rack (>= 1, < 3) + thor (1.2.2) + timeout (0.4.0) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + websocket (1.2.9) + websocket-driver (0.7.6) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + xpath (3.2.0) + nokogiri (~> 1.8) + zeitwerk (2.6.11) + +PLATFORMS + x86_64-linux + +DEPENDENCIES + bundler + byebug + capybara + jquery-rails + minitest-reporters + pry + pry-byebug + puma + rails + rake + selenium-webdriver + sprockets (< 4) + sprockets-rails + sqlite3 + teaspoon-mocha + thin + turbograft! + +BUNDLED WITH + 2.4.8 diff --git a/test/controller/legacy_pages_controller_test.rb b/test/controller/legacy_pages_controller_test.rb index 2de3b190..64eed8d2 100644 --- a/test/controller/legacy_pages_controller_test.rb +++ b/test/controller/legacy_pages_controller_test.rb @@ -15,7 +15,7 @@ class LegacyPagesControllerTest < ActionController::TestCase get :index assert_response :ok assert_equal "Turbolinks.visit('http://test.host/legacy_pages/1');", response.body - assert_equal Mime[:js], response.content_type + assert_equal Mime[:js], response.media_type end test "abort_xdomain_redirect returns 403 when cross origin" do diff --git a/test/controller/pages_controller_test.rb b/test/controller/pages_controller_test.rb index 0ab359da..f955ef1f 100644 --- a/test/controller/pages_controller_test.rb +++ b/test/controller/pages_controller_test.rb @@ -15,7 +15,7 @@ class PagesControllerTest < ActionController::TestCase get :index assert_response :ok assert_equal "Turbolinks.visit('http://test.host/pages/1');", response.body - assert_equal Mime[:js], response.content_type + assert_equal Mime[:js], response.media_type end test "abort_xdomain_redirect returns 403 when cross origin" do diff --git a/test/example/config/application.rb b/test/example/config/application.rb index 3fe8811c..f6f214c8 100644 --- a/test/example/config/application.rb +++ b/test/example/config/application.rb @@ -1,6 +1,7 @@ require File.expand_path('../boot', __FILE__) require "rails/all" +require "sprockets/rails" require "turbograft" require "jquery-rails" require 'rails/all'