私はこのコードを継承しており、これが偽のapi呼び出しのためのスタブを作成していることに気付いています。私はそれがどのように働いているのか分かりません。 JSONだけを返すことはできますか?単純に200回の成功を収めてもらえますか?これに関する文書はありますか?あなたはactive-rest-client
のドキュメントを読んでいる場合/fakeは何ができますか?
class GuessTransaction < ActiveRestClient::Base
request_body_type :json
get :all, '/transaction', fake: [{last_name:"Durdan", first_name:"Tyler"}]
get :find, '/transaction/:id', fake: {id: "1", first_name:"Tyler", last_name: "Durdan"}
post :create, '/transaction', fake:->(request) { {id: 12345 } }
end
ありがとうございました! [link](https://github.com/whichdigital/active-rest-client)は私が探していたものです。 – CheeseFry