From 50e5ac6d605af43ab0e7eb1ea4773bfad56b09d0 Mon Sep 17 00:00:00 2001 From: Randall Floyd Date: Fri, 13 Dec 2024 14:30:45 -0500 Subject: [PATCH] Changing expectations where ::Hash was testing equal to ActionController::Parameters, now deprecated --- .../hyrax/forms/failed_submission_form_wrapper_spec.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/spec/forms/hyrax/forms/failed_submission_form_wrapper_spec.rb b/spec/forms/hyrax/forms/failed_submission_form_wrapper_spec.rb index 1f448d2bb9..c57b005403 100644 --- a/spec/forms/hyrax/forms/failed_submission_form_wrapper_spec.rb +++ b/spec/forms/hyrax/forms/failed_submission_form_wrapper_spec.rb @@ -34,8 +34,13 @@ expect(wrapper.title).to eq(input_params.fetch(:title)) expect(wrapper[:title]).to eq(input_params.fetch(:title)) - expect(wrapper.member_of_collections_attributes).to eq(input_params.fetch(:member_of_collections_attributes)) - expect(wrapper[:member_of_collections_attributes]).to eq(input_params.fetch(:member_of_collections_attributes)) + # Params come back from wrapper as ActionController::Parameters in a regular hash, so we have to do the same to input_params + params_hash = {} + input_params.fetch("member_of_collections_attributes").each_pair do |nested_key, nested_value| + params_hash[nested_key] = nested_value + end + expect(wrapper.member_of_collections_attributes).to eq(params_hash) + expect(wrapper[:member_of_collections_attributes]).to eq(params_hash) expect { wrapper.obviously_missing_attribute }.to raise_error(NoMethodError) end