class SessionsController < ApplicationController::Base
def create
result = verify_sms_code(params[:session][:phone], params[:session][:code]
if result['code'] == 200
render json: {code: 200, msg: 'success'}
else
render json: {code: 404, msg: 'failed'}
end
end
end
verify_sms_code
method returns JSON result,e.g {'code':200, data:'correct'} or {'code':404, data:'incorrect'} ,how can I test this action with verify_sms_code method different return values? Thanks!--
You received this message because you are subscribed to the Google Groups "rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rspec+un...@googlegroups.com.
To post to this group, send email to rs...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rspec/848b2139-5848-4b41-a471-6c42085fe5df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/rspec/8410970d-fd70-48e4-9c93-87ef958c8496%40googlegroups.com.