File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 34
34
expect ( wrapper . title ) . to eq ( input_params . fetch ( :title ) )
35
35
expect ( wrapper [ :title ] ) . to eq ( input_params . fetch ( :title ) )
36
36
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 )
39
44
40
45
expect { wrapper . obviously_missing_attribute } . to raise_error ( NoMethodError )
41
46
end
You can’t perform that action at this time.
0 commit comments