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 invoke third party api from network, the api returns json result for validation short message.
How can I test create action? Thanks
Aucun commentaire:
Enregistrer un commentaire