Commit Graph

7 Commits

Author SHA1 Message Date
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
Carlos Antonio da Silva faef12cf2b Use the 6-0-stable version of Rails to fix issue with JSON responses
The test suite was failing on Rails 6.0 + Ruby 3 with errors like:

    Expected "{\"errors\":\"#<ActiveModel::Errors:0x000055f2e6cb8188>\"}"
    to include "{\"errors\":{".

The ActiveModel::Errors object wasn't being serialized to JSON as
expected, and this only happened with that combination of Ruby/Rails.

Upon further investigation, this was caused by a change in Ruby and
fixed in Rails in this PR: https://github.com/rails/rails/pull/39697
(which describes in more details the exact same problem and links to the
Ruby bug tracker with more information).

That fix was backported to 6-0-stable in June 2020, but hasn't been
officially released in a stable version yet: (there have been only
security fixes since then for 6.0)
75f6539d0e

Since the branch contains the fix, I'm pointing directly to it to get
the tests passing. We can't tell if there'll be a new stable 6.0 release
at this point, but hopefully yes, in which case we can go back at
pointing to it.
2021-02-15 16:33:03 -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 e07932c181 Rename gemfiles to keep consistency 2021-01-31 09:54:47 -03:00