5.0.1のアプリケーションを5.1にアップグレードしましたが、巨大なのrspecテストを実行する度に警告が表示されます。Rails 5.1のテストで変更された属性が廃止されました警告
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)
これは私が持っているすべてのテストで続き、コンソールには非常に多くのものを書いているので、かなり長い時間がかかります。
私は、違反コードが何か変わっていないので、私は何を変えなければならないのか、むしろ混乱しています。
はここでライン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
...
周りproducts_spec.rbだ私はそれが前にフィルタで何かを持っていると仮定しますが、私はかなり何を把握することはできません。警告を検索すると何も役に立ちません。
ありがとうございました。ここで提案されているよう
を - すべてのメッセージは、同様の線に沿って何かを言います。私の質問は、私が間違っているのは、それが参照している行のメッセージに記載されているコードを持っていないので、問題を解決する方法がわかりません。多分あなたには明らかですが、私は完全に迷っています。 –