mirror of
https://github.com/heartcombo/devise.git
synced 2026-04-28 03:00:29 -04:00
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.
This commit is contained in:
@@ -5,7 +5,6 @@ require 'shared_user'
|
||||
class User < ActiveRecord::Base
|
||||
include Shim
|
||||
include SharedUser
|
||||
include ActiveModel::Serializers::Xml if Devise::Test.rails5_and_up?
|
||||
|
||||
validates :sign_in_count, presence: true
|
||||
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
class UsersController < ApplicationController
|
||||
prepend_before_action :current_user, only: :exhibit
|
||||
before_action :authenticate_user!, except: [:accept, :exhibit]
|
||||
respond_to :html, :xml
|
||||
clear_respond_to
|
||||
respond_to :html, :json
|
||||
|
||||
def index
|
||||
user_session[:cart] = "Cart"
|
||||
|
||||
Reference in New Issue
Block a user