diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3b40b29c..f0e84681 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,9 +34,7 @@ jobs: ruby: '3.1' - gemfile: gemfiles/Gemfile-rails-6-0 env: DEVISE_ORM=mongoid - # TODO: lock `ubunty-20.04` due to older Ruby version compatibility, change to `ubuntu-latest` again when dropping older Ruby support. - # https://github.com/ruby/setup-ruby/issues/496#issuecomment-1520662740 - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps BUNDLE_GEMFILE: ${{ matrix.gemfile }} steps: @@ -45,8 +43,6 @@ jobs: with: ruby-version: ${{ matrix.ruby }} bundler-cache: true # runs bundle install and caches installed gems automatically - bundler: ${{ env.BUNDLER_VERSION || 'default' }} - rubygems: ${{ env.RUBYGEMS_VERSION || 'latest' }} - uses: supercharge/mongodb-github-action@1.9.0 if: ${{ matrix.env == 'DEVISE_ORM=mongoid' }} - run: bundle exec rake diff --git a/README.md b/README.md index caecead2..e76d8b3f 100644 --- a/README.md +++ b/README.md @@ -644,7 +644,7 @@ Unlike controller tests, integration tests do not need to supply the `devise.mapping` `env` value, as the mapping can be inferred by the routes that are executed in your tests. -You can read more about testing your Rails 3 - Rails 4 controllers with RSpec in the wiki: +You can read more about testing your Rails controllers with RSpec in the wiki: * https://github.com/heartcombo/devise/wiki/How-To:-Test-controllers-with-Rails-(and-RSpec) diff --git a/bin/test b/bin/test index 3670b19d..28141f2c 100755 --- a/bin/test +++ b/bin/test @@ -1,17 +1,12 @@ #!/usr/bin/env ruby $: << File.expand_path(File.expand_path('../../test', __FILE__)) -# Remove this begin/rescue once Rails 4 support is removed. -begin - require 'bundler/setup' - require 'rails/test_unit/runner' - require 'rails/test_unit/reporter' - require 'rails/test_unit/line_filtering' +require 'bundler/setup' +require 'rails/test_unit/runner' +require 'rails/test_unit/reporter' +require 'rails/test_unit/line_filtering' - Rails::TestUnitReporter.executable = 'bin/test' +Rails::TestUnitReporter.executable = 'bin/test' - Rails::TestUnit::Runner.parse_options(ARGV) - Rails::TestUnit::Runner.run(ARGV) -rescue LoadError - exec 'rake' -end +Rails::TestUnit::Runner.parse_options(ARGV) +Rails::TestUnit::Runner.run(ARGV) diff --git a/test/rails_app/app/controllers/streaming_controller.rb b/test/rails_app/app/controllers/streaming_controller.rb index 5fd711c2..1045fea1 100644 --- a/test/rails_app/app/controllers/streaming_controller.rb +++ b/test/rails_app/app/controllers/streaming_controller.rb @@ -8,16 +8,4 @@ class StreamingController < ApplicationController def index render body: 'Index' end - - # Work around https://github.com/heartcombo/devise/issues/2332, which affects - # tests in Rails 4.x (and affects production in Rails >= 5) - def process(name) - super(name) - rescue ArgumentError => e - if e.message == 'uncaught throw :warden' - throw :warden - else - raise e - end - end end diff --git a/test/test_helper.rb b/test/test_helper.rb index c0bb43f7..ad5a6db6 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -23,22 +23,6 @@ end if ActiveSupport.respond_to?(:test_order) ActiveSupport.test_order = :random end -class ActiveSupport::TestCase - if ActiveSupport.version < Gem::Version.new("5.0") - def assert_deprecated(match, deprecator) - super(match) do - # TODO: remove extra begin..end when dropping support for Ruby <= 2.4 - begin - behavior = deprecator.behavior - deprecator.behavior = ActiveSupport::Deprecation.behavior - yield - ensure - deprecator.behavior = behavior - end - end - end - end -end OmniAuth.config.logger = Logger.new('/dev/null')