|
1 | 1 | # |
2 | 2 | # -------------------------------------------------------------------------------------------------------------------- |
3 | 3 | # <copyright company="Aspose" file="document_tests.rb"> |
4 | | -# Copyright (c) 2018 Aspose.Words for Cloud |
| 4 | +# Copyright (c) 2019 Aspose.Words for Cloud |
5 | 5 | # </copyright> |
6 | 6 | # <summary> |
7 | 7 | # Permission is hereby granted, free of charge, to any person obtaining a copy |
@@ -37,28 +37,26 @@ def test_folder |
37 | 37 | def test_get_document |
38 | 38 | filename = 'test_multi_pages.docx' |
39 | 39 | remote_name = 'TestGetDocument.docx' |
| 40 | + remote_path = File.join(test_folder, remote_name) |
| 41 | + upload_file File.join(local_common_folder, filename), remote_path |
40 | 42 |
|
41 | | - st_request = PutCreateRequest.new remote_test_folder + test_folder + '/' + remote_name, File.open(local_common_folder + filename, "r").read |
42 | | - @storage_api.put_create st_request |
43 | | - |
44 | | - request = GetDocumentRequest.new remote_name, remote_test_folder + test_folder |
| 43 | + request = GetDocumentRequest.new remote_name, test_folder |
45 | 44 | result = @words_api.get_document request |
46 | | - assert_equal 200, result.code |
| 45 | + assert_equal false, result.document.nil? |
47 | 46 | end |
48 | 47 |
|
49 | 48 | # |
50 | 49 | # Test for creating document |
51 | 50 | # |
52 | | - def test_put_create_document |
| 51 | + def test_create_document |
53 | 52 | filename = 'test_multi_pages.docx' |
54 | | - remote_name = 'TestPutCreateDocument.docx' |
| 53 | + remote_name = 'TestCreateDocument.docx' |
55 | 54 |
|
56 | | - st_request = PutCreateRequest.new remote_test_folder + test_folder + '/' + remote_name, File.open(local_common_folder + filename, "r").read |
57 | | - @storage_api.put_create st_request |
| 55 | + upload_file(local_common_folder + filename, remote_test_folder + test_folder + '/' + remote_name) |
58 | 56 |
|
59 | | - request = PutCreateDocumentRequest.new nil, remote_name, remote_test_folder + test_folder |
60 | | - result = @words_api.put_create_document request |
61 | | - assert_equal 200, result.code |
| 57 | + request = CreateDocumentRequest.new nil, remote_name, remote_test_folder + test_folder |
| 58 | + result = @words_api.create_document request |
| 59 | + assert_equal false, result.document.nil? |
62 | 60 | end |
63 | 61 | end |
64 | 62 | end |
0 commit comments