Im new to this mocking and stubbing in rspec. Actually in my controller, i have an action method invite. I would like to mock/stub this invite method in my contoller.... Below is my code:
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 is the parameter which invite action(Through Post Method) accepts and i want it to return return_enrollment...