Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 31 lines (25 sloc) 0.936 kB
7358aa6 @adelevie support Cloud Functions
authored
1 require 'helper'
2
880730f @ericcj retry on server errors, show server error status in empty responses, …
ericcj authored
3 class TestCloud < ParseTestCase
ab7f734 @rhymes Explicitly pass the client to all objects using it.
rhymes authored
4 # functions stored in test/cloud_functions/MyCloudCode
5 # see https://parse.com/docs/cloud_code_guide to learn how to use Parse Cloud Code
6 #
7 # Parse.Cloud.define('trivial', function(request, response) {
8 # response.success(request.params);
9 # });
7358aa6 @adelevie support Cloud Functions
authored
10
ab7f734 @rhymes Explicitly pass the client to all objects using it.
rhymes authored
11 def test_cloud_function_initialize
5ea1798 @rhymes Add more tests
rhymes authored
12 cloud_function = Parse::Cloud::Function.new('trivial', @client)
13 assert cloud_function.function_name == 'trivial'
ab7f734 @rhymes Explicitly pass the client to all objects using it.
rhymes authored
14 end
7358aa6 @adelevie support Cloud Functions
authored
15
5ea1798 @rhymes Add more tests
rhymes authored
16 def test_cloud_function_uri
17 assert Parse::Cloud::Function.new('trivial', @client).uri
18 end
19
20 def test_cloud_function_call
dd64ea6 @rhymes Switched to minitest for better reliability and better testing overall.
rhymes authored
21 skip('this should automate the parse deploy command by committing that binary to the repo')
508d768 @ericcj omit tests that depended on their vcr fixtures to pass
ericcj authored
22
5ea1798 @rhymes Add more tests
rhymes authored
23 VCR.use_cassette('test_cloud_function_call') do
a153a0f @rhymes Cleanup code with Rubocop
rhymes authored
24 function = Parse::Cloud::Function.new('trivial', @client)
25 params = { 'foo' => 'bar' }
ab7f734 @rhymes Explicitly pass the client to all objects using it.
rhymes authored
26 resp = function.call(params)
27 assert_equal resp, params
28 end
29 end
30 end
Something went wrong with that request. Please try again.