Rails 5.1 testing changed attributes Deprecation warning
I just upgraded my 5.0.1 app to 5.1 and I get a huge amount of warnings when I run rspec tests.
DEPRECATION WARNING: ActiveSupport.halt_callback_chains_on_return_false= is deprecated and will be removed in Rails 5.2. (called from <top (required)> at /home/doomy/Documents/rsm/config/initializers/new_framework_defaults.rb:23)
...DEPRECATION WARNING: The behavior of `changed_attributes` inside of after callbacks will be changing in the next version of Rails. The new return value will reflect the behavior of calling the method after `save` returned (e.g. the opposite of what it returns now). To maintain the current behavior, use `saved_changes.transform_values(&:first)` instead. (called from block (3 levels) in <top (required)> at /home/doomy/Documents/rsm/spec/controllers/products_spec.rb:48)
DEPRECATION WARNING: The behavior of `changes` inside of after callbacks will be changing in the next version of Rails. The new return value will reflect the behavior of calling the method after `save` returned (e.g. the opposite of what it returns now). To maintain the current behavior, use `saved_changes` instead. (called from block (3 levels) in <top (required)> at /home/doomy/Documents/rsm/spec/controllers/products_spec.rb:48)
DEPRECATION WARNING: The behavior of `changed` inside of after callbacks will be changing in the next version of Rails. The new return value will reflect the behavior of calling the method after `save` returned (e.g. the opposite of what it returns now). To maintain the current behavior, use `saved_changes.keys` instead. (called from block (3 levels) in <top (required)> at /home/doomy/Documents/rsm/spec/controllers/products_spec.rb:48)
DEPRECATION WARNING: The behavior of `attribute_change` inside of after callbacks will be changing in the next version of Rails. The new return value will reflect the behavior of calling the method after `save` returned (e.g. the opposite of what it returns now). To maintain the current behavior, use `saved_change_to_attribute` instead. (called from block (3 levels) in <top (required)> at /home/doomy/Documents/rsm/spec/controllers/products_spec.rb:48)
This continues for every test I have and ends up taking significantly longer as it records so many things to the console.
I am rather confused as to what I should be changing as the offending code does not look out of the ordinary.
Here products_spec.rb around line 48
describe "GET show" do
before(:each) do
@product = create(:product, user: create(:product_admin))
end
context "anonymously" do
it "renders" do
get :show, params: { id: @product.id }
expect(response).to render_template("show")
end
end
context "as regular user" do
it "renders" do
get :show, params: { id: @product.id }
login(create(:user))
expect(response).to render_template("show")
end
end
...
I am guessing it should do something with the before filter, but I can't figure out what. Searching for the warning returns nothing useful.
Thank.
+3
source to share
1 answer
Try updating Carrierwave as suggested here: https://github.com/lebedev-yury/carrierwave-base64/issues/53
+2
source to share