137 Commits

Author SHA1 Message Date
Carlos Antonio da Silva
6f8f38d795 Update dependencies and test with Ruby 4.0
https://www.ruby-lang.org/en/news/2025/12/25/ruby-4-0-0-released/

We need to add `ostruct` as a dev dependency because it doesn't come
as a default gem with Ruby 4.0 anymore.

Lock minitest < 6 since v6 has some incompatibilities with released
versions of Rails that will be fixed in future versions.

This is something I didn't run into a few other gems, but SimpleForm
did, presumabily because it touches additional areas like AV tests.
2025-12-29 17:37:19 -03:00
Carlos Antonio da Silva
dd7ee27f74 Bring back Mongoid official support (#5568)
Devise hasn't been tested with Mongoid since Rails version 5, only 4.x was still running those tests.

This enables the tests again on all currently supported Rails versions, with their respective mongoid supported versions. There were a couple of minor tweaks to make it happen, namely:

* The way we were dropping the session before doesn't work in later versions so I changed back to calling `purge!` which appears to work fine. We used to call `Mongoid.purge!` but that changed in #4686.
* Some of the configs in the Rails test app were setting Active Record values when outside of the AR ORM tests, updated those to make sure they are not set when running mongoid ORM tests.
* The validations added to the shared admin code in tests were only checking for Rails version 5.1, but we need to use the same check for AR 5.1 that is used in code, otherwise it will try to use methods not available in mongoid there.
2025-10-31 11:16:02 -03:00
Carlos Antonio da Silva
d60f810086 Use currently released version of rails-controller-testing
We pointed to github to fix issues with Ruby 2.7 and kwargs, but since
then a version 1.0.5 was released which includes those fixes.

There's a few more things in their main, but nothing we need if all is
green.
2025-10-24 11:36:46 -03:00
Carlos Antonio da Silva
1cf31d45eb Update to test with Rails v8.1.0 final 2025-10-24 11:23:10 -03:00
Greg Molnar
dbc8e77ea0 Make test suite work (#5770)
* Drop support for Rails < 7 and Ruby < 2.7
* Add tests to support to Rails 8+
* Fix test suite across all supported versions
2025-10-21 16:52:04 -03:00
Carlos Antonio da Silva
14aa380d80 Update mocha to fix issue with Minitest compatibility layer
There's a number of deprecation warnings to work through related to
mocha updates in v2+, we'll get through those on a separate change.
https://github.com/freerange/mocha/blob/main/RELEASE.md#200

The main issue is with Minitest, fixed in v2.1:
https://github.com/freerange/mocha/blob/main/RELEASE.md#210

Also run `bundle update` on the main Gemfile to update all dependencies
there to latest.
2023-10-10 10:51:46 -03:00
Carlos Antonio da Silva
c4c8fad66c Use Rails 7.1 on main Gemfile and create a new one for 7.0 2023-10-10 10:51:46 -03:00
Peter Goldstein
90f46bac37 Monkeypatch webrat for Nokogiri compatibility
This is an attempt to address the Webrat / Nokogiri compatibility issue
[discussed here]. It monkeypatches Webrat to explicitly add the old
default arguments to the invocation of to_xpath.

Move monkey patch to its own file under test/support/webrat.
I really need to get rid of webrat.

Closes #5475

[discussed here] https://github.com/sparklemotion/nokogiri/issues/2469
2023-03-01 22:06:40 -03:00
Carlos Antonio da Silva
0d392fa49f Use the released version of responders v3.1.0
Unfortunately we can't enforce the version in the gemspec because
responders only supports Rails 5.2 now, and Devise still supports
previous versions.

We'll drop support for those in a future major release, so for now I'm
not adding any version.

This also adds a warning in case someone is using an older version of
responders and tries to set the error/redirect statuses via Devise, so
that they know what to do (upgrade responders) in that case.
2023-02-03 14:09:42 -03:00
Carlos Antonio da Silva
f08e0ad24a Integrate with Hotwire/Turbo by configuring error and response statuses
Treat `:turbo_stream` request format as a navigational format, much like
HTML, so Devise/responders can work properly.

Allow configuring the `error_status` and `redirect_status` using the
latest responders features, via a new custom Devise responder, so we can
customize the both responses to match Hotwire/Turbo behavior, for
example with `422 Unprocessable Entity` and `303 See Other`,
respectively. The defaults aren't changing in Devise itself (yet), so it
still responds on errors cases with `200 OK`, and redirects on non-GET
requests with `302 Found`, but new apps are generated with the new
statuses and existing apps can opt-in. Please note that these defaults
might change in a future release of Devise.

PRs/Issues references:

https://github.com/heartcombo/devise/pull/5545
https://github.com/heartcombo/devise/pull/5529
https://github.com/heartcombo/devise/pull/5516
https://github.com/heartcombo/devise/pull/5499
https://github.com/heartcombo/devise/pull/5487
https://github.com/heartcombo/devise/pull/5467
https://github.com/heartcombo/devise/pull/5440
https://github.com/heartcombo/devise/pull/5410
https://github.com/heartcombo/devise/pull/5340

https://github.com/heartcombo/devise/issues/5542
https://github.com/heartcombo/devise/issues/5530
https://github.com/heartcombo/devise/issues/5519
https://github.com/heartcombo/devise/issues/5513
https://github.com/heartcombo/devise/issues/5478
https://github.com/heartcombo/devise/issues/5468
https://github.com/heartcombo/devise/issues/5463
https://github.com/heartcombo/devise/issues/5458
https://github.com/heartcombo/devise/issues/5448
https://github.com/heartcombo/devise/issues/5446
https://github.com/heartcombo/devise/issues/5439
2023-01-31 11:02:01 -03:00
Peter Goldstein
3c5acaf531 Add Ruby 3.1 to CI matrix. Lock to Nokogiri < 1.13 for webrat compatibility 2022-02-23 08:37:31 -08:00
Dino Maric
289dd5f221 Add support for Rails 7
This commit adds support for latest Rails release.
2021-12-16 10:12:05 +01:00
Carlos Antonio da Silva
9f5b83750e Bundle update to Rails 7.0 rc1 2021-12-08 08:26:05 -03:00
Carlos Antonio da Silva
f3e8fd3baa Move the Gemfile to test with Rails 7.0 alpha2, fix session test issue
It appears setting the `rack.session` to a simple hash doesn't work
anymore as it now has a few additional methods Rails is relying on to
determine whether it's enabled or not:
https://github.com/rails/rails/pull/42231

Failure:
    NoMethodError: undefined method `enabled?' for {}:Hash
    rails (f55cdafe4b82) actionpack/lib/action_dispatch/middleware/flash.rb:62:in `commit_flash'

Turns we we don't seem to need to set `rack.session` for the tests here.
2021-10-07 18:08:16 -03:00
Carlos Antonio da Silva
a793472a3e Replace XML with JSON serialization across the test suite
This allows us to remove the dependency on the XML serializer provided
by the external `activemodel-serializers-xml` gem, and eliminates the
following deprecation warning:

    DEPRECATION WARNING: ActiveModel::Errors#to_xml is deprecated and
    will be removed in Rails 6.2.

Please note: this does not mean Devise doesn't support XML, it simply
means our test suite will use JSON to test non-navigatable formats
instead of XML, for simplicity. Devise's job is not to test object
serialization, so as long as your objects properly serialize to
XML/JSON/any other format, it should work out of the box.
2021-02-15 14:40:05 -03:00
Carlos Antonio da Silva
ad91686b62 Test on Ruby 3+ with Rails 6+
And remove dupe entry in the exclude matrix.

In order to get Ruby 3 working we needed to install `rexml` as part of
the test dependencies, only done on the main Gemfile (Rails 6.1) and the
6.0 versions. (which are the only ones supported by Ruby 3.)

Devise itself doesn't require `rexml` as it does nothing with it, but a
dependency we use during tests seem to require it. I was able to track
it down to omniauth-openid -> rack-openid -> ruby-openid requiring it:

    13a88ad644/lib/openid/yadis/xrds.rb (L1)

So while we have tests using omniauth-openid, we'll need this require in
place as well. Ideally that upstream version of ruby-openid should have
it, but it seems that one isn't updated in a while.
2021-02-15 14:34:36 -03:00
Carlos Antonio da Silva
9d16f33c7b Revert "Explicitly set OmniAuth to 1.x in the Gemfiles for now"
This reverts commit 628f2fb2be.

We should be run green on OmniAuth 2.x now.
2021-02-01 11:51:23 -03:00
Carlos Antonio da Silva
628f2fb2be Explicitly set OmniAuth to 1.x in the Gemfiles for now
The build is breaking with 2.x (which is expected), so this is a step to
get it to green on GA.
2021-01-31 10:19:06 -03:00
Carlos Antonio da Silva
fb17e2755f Move Rails 6.1 to the main Gemfile instead of an extra one
We have the gemfiles/* to test other versions of Rails, but keep the
most recent one in the main Gemfile.
2021-01-18 21:52:07 -03:00
Carlos Antonio da Silva
50f820a6cf Use master of Rails controller testing gem to remove Ruby 2.7 warning 2020-06-07 20:00:17 -03:00
Carlos Antonio da Silva
22e2ab4be3 Update Gemfile to point to Rails 6.0.x
This is essentially the same as `gemfiles/Gemfile.rails-6.0-stable`, but
I'm keeping both for now since I want to change the main `Gemfile` later
to point to Rails master (`6.1.0.alpha`), so then I won't need to
recreate the `6.0-stable` Gemfile again.
2020-06-05 11:40:57 -03:00
Leonardo Tegon
45016829d6 Prepare for 4.6.0 release
It was necessary to manually set the `sqlite3` Gem version after the
release of version `1.4.0`.
See https://github.com/rails/rails/issues/35153 for more info.
2019-02-07 13:28:00 -02:00
Stan Hu
1192c76f62 Fix corner case when confirmation_sent_at is equal to 0.days.ago (#4529)
If `Confirmable#confirmation_sent_at` is equal to `0.days.ago`, then
`confirmation_period_valid?` will be deemed valid even if the setting is
configured to disable this outright. To prevent this error, we explicitly
check the configuration setting to be `0.days.ago`.
2018-12-04 14:34:32 -02:00
Lance Carlson
7eccd4e9c6 upgrade dependencies for rails and responders 2018-04-17 00:03:12 -04:00
Pat Allan
f39c6fd927 Add the frozen_string_literal pragma comment to all Ruby files. (#4725) 2017-12-21 15:36:29 -02:00
haneru
c74e2693a3 Removed gem minitest 2017-10-28 01:09:43 +09:00
Rafael Mendonça França
0f6014b84d Make sure we are using a version of minitest that is not broken with
Rails.
2017-05-11 19:06:29 -07:00
Rafael Mendonça França
801cf00146 Test by default with Rails 5.1 2017-04-28 15:33:43 -07:00
Lucas Mazza
2c8727ad42 Test against Rails 5 by default. 2016-07-01 14:13:20 -03:00
Lucas Mazza
593ae41f9d Update existing Gemfiles. 2016-05-18 13:59:06 -03:00
ALLEN WANG QIANG
78bbf6dcc4 Send on create confirmation email after commit (#4064)
Call send_on_create_confirmation_instructions in after_commit instead of after_create, I think this is no harm in general and it makes things like async job work.

Fix #4062
2016-05-02 21:32:14 -03:00
Yogesh Khater
9696d83e7d Upgrade Mongoid to 5.0 2016-04-19 17:18:40 +05:30
bogdanvlviv
c3c2438c9c change rails version from 4.2.5 to 4.2.6 2016-03-23 21:21:58 +02:00
Lucas Mazza
e6563bc4cb Update Gemfile's dependencies. 2016-03-09 11:13:04 -03:00
George Guimarães
4b8ea5d0f0 Updates the development/testing dependencies 2016-02-10 18:37:16 -02:00
Vincent Woo
b23f5223dd just use regular 4.x mongoid gem 2015-06-30 16:02:06 -07:00
camelmasa
1aaf6345a4 Update rails gem for security
See. http://weblog.rubyonrails.org/2015/6/16/Rails-3-2-22-4-1-11-and-4-2-2-have-been-released-and-more/
2015-06-17 15:42:42 +09:00
Carlos Antonio da Silva
79c6f47ad3 Bundle update 2015-03-24 09:00:38 -03:00
Carlos Antonio da Silva
5c5200b5d9 Update dependencies with the released 4.2.0 2014-12-27 11:15:08 -02:00
Lucas Mazza
2c8e242000 Use Rails 4.2.0.rc3. 2014-12-16 11:03:26 -02:00
Lucas Mazza
6fb466eb1e Use Rails 4.2.0.rc1 2014-12-01 10:18:00 -02:00
Lucas Mazza
1ed93cacd8 Update Rails dependency 2014-09-29 17:38:16 -03:00
Lucas Mazza
70e9e92d23 Reorganize Gemfiles. 2014-08-20 18:16:51 -03:00
Lucas Mazza
520dfe2eb4 Update the overall dependencies and test with mongoid 4.0.0 for now on. 2014-06-24 10:22:26 -03:00
Lucas Mazza
7bab20e55e Update main Gemfile dependencies. 2014-05-04 21:21:45 -03:00
Lucas Mazza
a8e1d42097 Bump mocha. 2014-03-12 14:40:11 -03:00
Lucas Mazza
aea82d0b03 Update remaning 1.8 hash syntax. 2014-02-25 14:25:55 -03:00
Lucas Mazza
0cb74efd79 Remove platform constraint from Gemfile since we do not support 1.8 anymore. 2014-01-03 11:23:01 -02:00
José Valim
57515de5ad Update to Rails 4.0 2013-07-09 09:09:22 +02:00
Carlos Antonio da Silva
eb0ad1c21a Merge branch 'master' into rails4 2013-05-07 13:01:34 -03:00