Skip to content

Commit 50e5ac6

Browse files
committed
Changing expectations where ::Hash was testing equal to ActionController::Parameters, now deprecated
1 parent 05aacaf commit 50e5ac6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

spec/forms/hyrax/forms/failed_submission_form_wrapper_spec.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,13 @@
3434
expect(wrapper.title).to eq(input_params.fetch(:title))
3535
expect(wrapper[:title]).to eq(input_params.fetch(:title))
3636

37-
expect(wrapper.member_of_collections_attributes).to eq(input_params.fetch(:member_of_collections_attributes))
38-
expect(wrapper[:member_of_collections_attributes]).to eq(input_params.fetch(:member_of_collections_attributes))
37+
# Params come back from wrapper as ActionController::Parameters in a regular hash, so we have to do the same to input_params
38+
params_hash = {}
39+
input_params.fetch("member_of_collections_attributes").each_pair do |nested_key, nested_value|
40+
params_hash[nested_key] = nested_value
41+
end
42+
expect(wrapper.member_of_collections_attributes).to eq(params_hash)
43+
expect(wrapper[:member_of_collections_attributes]).to eq(params_hash)
3944

4045
expect { wrapper.obviously_missing_attribute }.to raise_error(NoMethodError)
4146
end

0 commit comments

Comments
 (0)