Grapeではto_jsonはいらないよ


grape側のAPI

{ error: "not exist cache" }.to_json


format :json 指定したらいらないらしい

to_jsonを行った場合に以下のような違いが出てくる。

expected: "{\"error\":\"not exist cache\"}"
got: "\"{\\\"error\\\":\\\"not exist cache\\\"}\""


テストコードを書いてて、これと1時間にらめっこしてしまった。