File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 27
27
expect ( response ) . to be_successful
28
28
expect ( assigns [ :presenter ] ) . to be_kind_of Hyrax ::AdminStatsPresenter
29
29
expect ( assigns [ :presenter ] )
30
- . to have_attributes ( limit : 5 , stats_filters : { } )
30
+ . to have_attributes ( limit : 5 , stats_filters : ActionController :: Parameters . new ( { } ) )
31
31
end
32
32
33
33
context 'with a custom presenter' do
40
40
41
41
expect ( assigns [ :presenter ] ) . to be_kind_of presenter_class
42
42
expect ( assigns [ :presenter ] )
43
- . to have_attributes ( limit : 5 , stats_filters : { } )
43
+ . to have_attributes ( limit : 5 , stats_filters : ActionController :: Parameters . new ( { } ) )
44
44
end
45
45
end
46
46
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