Sha256: 00aef160e059a72e6c6f8f079ab8fdb60d63b988b042e92a1bda33d2fd673c50

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

require 'helper'

class TestCloud < AVTestCase
	# functions stored in test/cloud_functions/MyCloudCode
	# see https://parse.com/docs/cloud_code_guide to learn how to use AV Cloud Code
	#
	# AV.Cloud.define('trivial', function(request, response) {
  # 	response.success(request.params);
	# });

	def test_cloud_function_initialize
		assert_not_equal nil, AV::Cloud::Function.new("trivial")
	end

    def test_request_sms
      VCR.use_cassette('test_request_sms', :record => :new_episodes) do
        assert_equal (AV::Cloud.request_sms :mobilePhoneNumber => "18668012283",:op => "test",:ttl => 5), {}
        puts AV::Cloud.verify_sms_code('18668012283', '123456').inspect
      end
    end

	def test_cloud_function
		omit("this should automate the parse deploy command by committing that binary to the repo")

		VCR.use_cassette('test_cloud_function', :record => :new_episodes) do
			function = AV::Cloud::Function.new("trivial")
			params = {"foo" => "bar"}
			resp = function.call(params)
			assert_equal resp, params
		end
	end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
leancloud-ruby-client-0.1.1 test/test_cloud.rb