rspecでのこのモックとスタブは初めてです。実際、私のコントローラーには、アクション メソッドの招待があります。コントローラーでこの招待メソッドをモック/スタブしたいと思います....以下は私のコードです:
when(/^I invite a subject with required attributes$/) do
patient_enrollment = {subject_enrollment{
country_code: "USA",
subject_id: "Subj 100",
subject_uuid: "23451"}}
return_enrollment = {subject_enrollment{
country_code: "USA",
subject_id: "Subj 100",
activation_code: "xcvbnh",
subject_uuid: "23451"}}
Patient_enrollment は、招待アクション (Post メソッド経由) が受け入れるパラメーターであり、return_enrollment を返すようにしたい...