File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed
Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ def formatter_for(api_format)
3636 end
3737
3838 def format_json ( message )
39- { :error => message }
39+ { :error => message } . to_json
4040 end
4141
4242 def format_txt ( message )
Original file line number Diff line number Diff line change @@ -507,7 +507,7 @@ def two
507507 raise "rain!"
508508 end
509509 get '/exception'
510- last_response . body . should eql '{: error=> "rain!"}'
510+ last_response . body . should eql '{" error": "rain!"}'
511511 end
512512 it 'should rescue all errors' do
513513 subject . error_format :txt
@@ -523,7 +523,7 @@ def two
523523 error! ( "Access Denied" , 401 )
524524 end
525525 get '/error'
526- last_response . body . should eql '{: error=> "Access Denied"}'
526+ last_response . body . should eql '{" error": "Access Denied"}'
527527 end
528528 end
529529
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ def app
6565 run ExceptionApp
6666 end
6767 get '/'
68- last_response . body . should == '{: error=> "rain!"}'
68+ last_response . body . should == '{" error": "rain!"}'
6969 end
7070
7171 it 'should be possible to specify a custom formatter' do
You can’t perform that action at this time.
0 commit comments