File tree Expand file tree Collapse file tree 4 files changed +9
-9
lines changed Expand file tree Collapse file tree 4 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -42,12 +42,12 @@ def include_foo!
4242
4343 it 'does not include extra fields when not requested' do
4444 get :index
45- expect ( json_items ( 0 ) . keys ) . to match_array ( %w( id jsonapi_type first-name last-name ) )
45+ expect ( json_items ( 0 ) . keys ) . to match_array ( %w( id jsonapi_type first_name last_name ) )
4646 end
4747
4848 it 'includes the extra fields in the response when requested' do
4949 get :index , params : { extra_fields : { authors : 'net_worth' } }
50- expect ( json_items ( 0 ) . keys ) . to match_array ( %w( id jsonapi_type first-name last-name net-worth ) )
50+ expect ( json_items ( 0 ) . keys ) . to match_array ( %w( id jsonapi_type first_name last_name net_worth ) )
5151 end
5252
5353 it 'alters the scope based on the supplied block' do
@@ -63,7 +63,7 @@ def include_foo!
6363
6464 it 'does not include the extra field in the response' do
6565 get :index , params : { extra_fields : { authors : 'net_worth' } }
66- expect ( json_items ( 0 ) . keys ) . to match_array ( %w( id jsonapi_type first-name last-name ) )
66+ expect ( json_items ( 0 ) . keys ) . to match_array ( %w( id jsonapi_type first_name last_name ) )
6767 end
6868 end
6969end
Original file line number Diff line number Diff line change @@ -34,17 +34,17 @@ def current_user
3434
3535 it 'limits to only the requested fields' do
3636 get :index
37- expect ( json_items ( 0 ) . keys ) . to match_array ( %w( id jsonapi_type first-name last-name uuid ) )
37+ expect ( json_items ( 0 ) . keys ) . to match_array ( %w( id jsonapi_type first_name last_name uuid ) )
3838 get :index , params : { fields : { authors : 'first_name,last_name' } }
39- expect ( json_items ( 0 ) . keys ) . to match_array ( %w( id jsonapi_type first-name last-name ) )
39+ expect ( json_items ( 0 ) . keys ) . to match_array ( %w( id jsonapi_type first_name last_name ) )
4040 end
4141
4242 it 'disallows fields guarded by :if, even if specified' do
4343 allow ( controller ) . to receive ( :current_user ) { 'admin' }
4444 get :index , params : { fields : { authors : 'first_name,salary' } }
45- expect ( json_items ( 0 ) . keys ) . to match_array ( %w( id jsonapi_type first-name salary ) )
45+ expect ( json_items ( 0 ) . keys ) . to match_array ( %w( id jsonapi_type first_name salary ) )
4646 allow ( controller ) . to receive ( :current_user ) { 'non-admin' }
4747 get :index , params : { fields : { authors : 'first_name,salary' } }
48- expect ( json_items ( 0 ) . keys ) . to match_array ( %w( id jsonapi_type first-name ) )
48+ expect ( json_items ( 0 ) . keys ) . to match_array ( %w( id jsonapi_type first_name ) )
4949 end
5050end
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ def index
4444 . once
4545 . and_call_original
4646 get :index
47- expect ( json_items ( 0 ) [ 'first-name ' ] ) . to eq ( 'Stephen' )
47+ expect ( json_items ( 0 ) [ 'first_name ' ] ) . to eq ( 'Stephen' )
4848 end
4949 end
5050
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ def index
2323 context 'when passing sort param' do
2424 subject do
2525 get :index , params : { sort : sort_param }
26- json_items . map { |n | n [ 'first-name ' ] }
26+ json_items . map { |n | n [ 'first_name ' ] }
2727 end
2828
2929 context 'asc' do
You can’t perform that action at this time.
0 commit comments