File tree 2 files changed +8
-3
lines changed
app/controllers/api/v1/gss
2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,8 @@ def show
16
16
else
17
17
shown_data = {
18
18
gss_name : gss_character . name ,
19
- nicknames : gss_character . nicknames . pluck ( :name )
19
+ nicknames : gss_character . nicknames . pluck ( :name ) ,
20
+ product_titles : gss_character . product_titles . pluck ( :name )
20
21
}
21
22
22
23
render json : shown_data
Original file line number Diff line number Diff line change 28
28
it { expect ( response ) . to have_http_status ( :success ) }
29
29
end
30
30
31
- describe '戻り値の key に "gss_name" と "nicknames" を含むこと ' do
31
+ describe '戻り値の key' do
32
32
before do
33
33
get '/api/v1/gss/characters/%E3%83%95%E3%83%AA%E3%83%83%E3%82%AF'
34
34
end
35
35
36
- it { expect ( JSON . parse ( response . body ) . keys ) . to include 'gss_name' , 'nicknames' }
36
+ it '期待どおりの値を含むこと' do
37
+ expect ( JSON . parse ( response . body ) . keys ) . to eq (
38
+ %w[ gss_name nicknames product_titles ]
39
+ )
40
+ end
37
41
end
38
42
end
39
43
end
You can’t perform that action at this time.
0 commit comments