mirror of
https://github.com/heartcombo/devise.git
synced 2026-01-07 22:14:04 -05:00
Remove some more code added to support older versions
Also change back to run CI on ubuntu-latest which should work with all Ruby versions supported now.
This commit is contained in:
6
.github/workflows/test.yml
vendored
6
.github/workflows/test.yml
vendored
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
19
bin/test
19
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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user