Commit Graph

15 Commits

Author SHA1 Message Date
Carlos Antonio da Silva e1c53d6580 Check for empty response body on redirect with Rails main (future 7.1)
Rails is no longer returning a message with the response body on
redirects, just an empty body.

https://github.com/rails/rails/pull/44554
2022-04-22 09:30:58 -03:00
Alex Ghiculescu b39faffde4
Test against Rails main and remove `ActiveSupport::Dependencies.reference` (#5357)
Remove `ActiveSupport::Dependencies.reference`

This was deleted from Rails: 14d4edd7c3

As far as I can tell, it was meant to add a performance boost at some point in the past but doesn't seem to do anything useful these days.
2021-10-07 17:18:37 -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 15135f7dc6 User `assert_includes`/`refute_includes` minitest helpers 2020-08-27 18:38:26 -03:00
Carlos Antonio da Silva e39b9b9134 Fix order of arguments for `assert_equal` on tests
Use `assert_equal expected, actual` for proper error messages in case of
failures.
2020-08-27 18:24:17 -03:00
Tony Novak 23fbc35b2d Fix hanging tests for streaming controllers using Devise
Fixes #5285.
2020-08-26 12:02:09 -04:00
Leonardo Tegon ad5892391d
Fix specs on Rails 6 RC2 (#5109)
* Fix specs on Rails 6 RC2

`ActiveRecord::MigrationContext` now has a `schema_migration` attribute.
Ref: https://github.com/rails/rails/pull/36439/files#diff-8d3c44120f7b67ff79e2fbe6a40d0ad6R1018

* Use `media_type` instead of `content_type`

Before Rails 6 RC2, the `ActionDispatch::Response#content_type` method
would return only the media part of the `Content-Type` header, without any
other parts. Now the `#content_type` method returns the entire header -
as it is - and `#media_type` should be used instead to get the previous
behavior.

Ref:
- https://github.com/rails/rails/pull/36034
- https://github.com/rails/rails/pull/36854

* Use render template instead of render file

Render file will need the full path in order to avoid security breaches.
In this particular case, there's no need to use render file, it's ok to
use render template.

Ref: https://github.com/rails/rails/pull/35688

* Don't set `represent_boolean_as_integer` on Rails 6

* Update comments [ci skip]
2019-08-07 12:32:01 -03:00
Leonardo Tegon c000b58c56
Add Rails 6 to CI (#5009) 2019-01-22 12:43:31 -02:00
Gordon McNaughton 3e23371b01 Preserve content_type for unauthenticated tests
In Rails 4, for unauthenticated controller tests which trigger the
failure app, ensure that the simulated failure response includes a
content_type (broken in bb44d42).

This works in Rails5, which parses the content-type header on-demand,
but not in Rails4 which requires setting the response's content_type
explicitly.

Fixes #4783.
2018-02-26 12:15:36 -05:00
Justin Coyne a45bbe1783 Test on Rails 5.2.0.rc1 (#4711) 2018-02-22 10:05:19 -03:00
Pat Allan f39c6fd927 Add the frozen_string_literal pragma comment to all Ruby files. (#4725) 2017-12-21 15:36:29 -02:00
Dan Schultzer be2e17841e Separate Devise test methods from Devise 2017-04-29 10:24:22 -07:00
Matthew Rudy Jacobs 7c4e8c8d17 Rails 5.1 requires ActionController::TestRequest to have a controller class
Pass it in as an anonymous class
2017-04-28 10:51:27 -05:00
Lucas Mazza 7b000390a0
Add `Devise::Test::IntegrationHelpers`. 2016-05-15 19:36:41 -03:00
Lucas Mazza 3f3ec236bb
Move `Devise::TestHelpers` to `Devise::Test::ControllerHelpers`. 2016-05-15 19:36:41 -03:00