File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ def after
40
40
throw :error , status : 500 , message : e . message
41
41
end
42
42
headers [ Grape ::Http ::Headers ::CONTENT_TYPE ] = content_type_for ( env [ 'api.format' ] ) unless headers [ Grape ::Http ::Headers ::CONTENT_TYPE ]
43
- Rack ::Response . new ( bodymap , status , headers ) . to_a
43
+ Rack ::Response . new ( bodymap , status , headers )
44
44
end
45
45
46
46
private
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ def to_json
21
21
end
22
22
end
23
23
24
- subject . call ( 'PATH_INFO' => '/somewhere' , 'HTTP_ACCEPT' => 'application/json' ) . last . each { |b | expect ( b ) . to eq ( '"bar"' ) }
24
+ subject . call ( 'PATH_INFO' => '/somewhere' , 'HTTP_ACCEPT' => 'application/json' ) . to_a . last . each { |b | expect ( b ) . to eq ( '"bar"' ) }
25
25
end
26
26
27
27
it 'calls #to_json if the content type is jsonapi' do
@@ -32,7 +32,7 @@ def to_json
32
32
end
33
33
end
34
34
35
- subject . call ( 'PATH_INFO' => '/somewhere' , 'HTTP_ACCEPT' => 'application/vnd.api+json' ) . last . each { |b | expect ( b ) . to eq ( '{"foos":[{"bar":"baz"}] }' ) }
35
+ subject . call ( 'PATH_INFO' => '/somewhere' , 'HTTP_ACCEPT' => 'application/vnd.api+json' ) . to_a . last . each { |b | expect ( b ) . to eq ( '{"foos":[{"bar":"baz"}] }' ) }
36
36
end
37
37
38
38
it 'calls #to_xml if the content type is xml' do
@@ -43,7 +43,7 @@ def to_xml
43
43
end
44
44
end
45
45
46
- subject . call ( 'PATH_INFO' => '/somewhere.xml' , 'HTTP_ACCEPT' => 'application/json' ) . last . each { |b | expect ( b ) . to eq ( '<bar/>' ) }
46
+ subject . call ( 'PATH_INFO' => '/somewhere.xml' , 'HTTP_ACCEPT' => 'application/json' ) . to_a . last . each { |b | expect ( b ) . to eq ( '<bar/>' ) }
47
47
end
48
48
end
49
49
You can’t perform that action at this time.
0 commit comments