mxhero-api 1.1.3 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +14 -0
- data/VERSION +1 -1
- data/lib/communication.rb +1 -0
- data/lib/email-sync.rb +78 -0
- data/lib/mxhero-api.rb +621 -617
- data/lib/response.rb +1 -0
- data/mxhero-api.gemspec +5 -5
- data/test/fixtures/api/emailsync_delete.yml +32 -0
- data/test/fixtures/api/emailsync_fetch_all.yml +34 -0
- data/test/fixtures/api/emailsync_task_by_id.yml +34 -0
- data/test/helper.rb +1 -1
- data/test/test_emailsync.rb +169 -0
- metadata +11 -2
data/lib/response.rb
CHANGED
data/mxhero-api.gemspec
CHANGED
@@ -1,23 +1,23 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: mxhero-api 1.1.
|
2
|
+
# stub: mxhero-api 1.1.4 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "mxhero-api"
|
6
|
-
s.version = "1.1.
|
6
|
+
s.version = "1.1.4"
|
7
7
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
9
9
|
s.require_paths = ["lib"]
|
10
10
|
s.authors = ["Maximiliano Dello Russo", "Juan Pablo Royo", "mxHero"]
|
11
|
-
s.date = "2016-
|
11
|
+
s.date = "2016-07-07"
|
12
12
|
s.description = "A gem to provide easy access to the API of MxHero platform (http://www.mxhero.com/)"
|
13
13
|
s.email = ["maxidr@mxhero.com", "juanpablo.royo@gmail.com", "mxhero@mxhero.com"]
|
14
|
-
s.files = [".gitignore", ".ruby-gemset", ".ruby-version", "Gemfile", "LICENSE.txt", "README.md", "Rakefile", "VERSION", "lib/communication.rb", "lib/directories.rb", "lib/dto.rb", "lib/groups.rb", "lib/mxhero-api.rb", "lib/pst-converter.rb", "lib/resource.rb", "lib/resources/account.rb", "lib/resources/domain.rb", "lib/resources/group.rb", "lib/response.rb", "lib/urls.rb", "mxhero-api.gemspec", "test/fixtures/api/account_properties.yml", "test/fixtures/api/account_properties_not_found.yml", "test/fixtures/api/accounts.yml", "test/fixtures/api/accounts_filtered.yml", "test/fixtures/api/accounts_from_domain.yml", "test/fixtures/api/accounts_from_domain_paginated.yml", "test/fixtures/api/accounts_without_group.yml", "test/fixtures/api/add_an_inexistent_account_to_group.yml", "test/fixtures/api/add_and_remove_account.yml", "test/fixtures/api/add_feature.yml", "test/fixtures/api/all_groups.yml", "test/fixtures/api/associate_user_domain.yml", "test/fixtures/api/create_directory.yml", "test/fixtures/api/create_domain.yml", "test/fixtures/api/create_rule_for_domain.yml", "test/fixtures/api/create_user.yml", "test/fixtures/api/delete_directory.yml", "test/fixtures/api/delete_group.yml", "test/fixtures/api/delete_rule.yml", "test/fixtures/api/domain_by_id.yml", "test/fixtures/api/domain_by_id_not_found.yml", "test/fixtures/api/domain_rule.yml", "test/fixtures/api/domains.yml", "test/fixtures/api/fetch_directory.yml", "test/fixtures/api/fetch_user.yml", "test/fixtures/api/ldap_info.yml", "test/fixtures/api/move_to_trial.yml", "test/fixtures/api/pst_inactive_tasks.yml", "test/fixtures/api/refresh_directory.yml", "test/fixtures/api/remove_account_from_group_twice.yml", "test/fixtures/api/remove_inexistente_account_from_group.yml", "test/fixtures/api/rule_status.yml", "test/fixtures/api/rules_for_domain.yml", "test/fixtures/api/rules_for_domain_by_component.yml", "test/fixtures/api/save_group.yml", "test/fixtures/api/system_properties.yml", "test/fixtures/api/system_properties_create.yml", "test/fixtures/api/system_properties_element.yml", "test/fixtures/api/test_domain.yml", "test/fixtures/api/update_account_properties.yml", "test/fixtures/api/update_accounts_group_scope.yml", "test/fixtures/api/update_accounts_properties_scope.yml", "test/fixtures/api/update_directory.yml", "test/fixtures/api/update_rule.yml", "test/fixtures/api/update_user.yml", "test/fixtures/api/user_domains.yml", "test/fixtures/api/users_for_domain.yml", "test/fixtures/api/validate_user_credential.yml", "test/fixtures/domain.rb", "test/helper.rb", "test/test_directories.rb", "test/test_domain.rb", "test/test_dto.rb", "test/test_feature.rb", "test/test_groups.rb", "test/test_mxhero_api.rb", "test/test_mxhero_api_response.rb", "test/test_pst-converter.rb", "test/test_resource.rb"]
|
14
|
+
s.files = [".gitignore", ".ruby-gemset", ".ruby-version", "Gemfile", "LICENSE.txt", "README.md", "Rakefile", "VERSION", "lib/communication.rb", "lib/directories.rb", "lib/dto.rb", "lib/email-sync.rb", "lib/groups.rb", "lib/mxhero-api.rb", "lib/pst-converter.rb", "lib/resource.rb", "lib/resources/account.rb", "lib/resources/domain.rb", "lib/resources/group.rb", "lib/response.rb", "lib/urls.rb", "mxhero-api.gemspec", "test/fixtures/api/account_properties.yml", "test/fixtures/api/account_properties_not_found.yml", "test/fixtures/api/accounts.yml", "test/fixtures/api/accounts_filtered.yml", "test/fixtures/api/accounts_from_domain.yml", "test/fixtures/api/accounts_from_domain_paginated.yml", "test/fixtures/api/accounts_without_group.yml", "test/fixtures/api/add_an_inexistent_account_to_group.yml", "test/fixtures/api/add_and_remove_account.yml", "test/fixtures/api/add_feature.yml", "test/fixtures/api/all_groups.yml", "test/fixtures/api/associate_user_domain.yml", "test/fixtures/api/create_directory.yml", "test/fixtures/api/create_domain.yml", "test/fixtures/api/create_rule_for_domain.yml", "test/fixtures/api/create_user.yml", "test/fixtures/api/delete_directory.yml", "test/fixtures/api/delete_group.yml", "test/fixtures/api/delete_rule.yml", "test/fixtures/api/domain_by_id.yml", "test/fixtures/api/domain_by_id_not_found.yml", "test/fixtures/api/domain_rule.yml", "test/fixtures/api/domains.yml", "test/fixtures/api/emailsync_delete.yml", "test/fixtures/api/emailsync_fetch_all.yml", "test/fixtures/api/emailsync_task_by_id.yml", "test/fixtures/api/fetch_directory.yml", "test/fixtures/api/fetch_user.yml", "test/fixtures/api/ldap_info.yml", "test/fixtures/api/move_to_trial.yml", "test/fixtures/api/pst_inactive_tasks.yml", "test/fixtures/api/refresh_directory.yml", "test/fixtures/api/remove_account_from_group_twice.yml", "test/fixtures/api/remove_inexistente_account_from_group.yml", "test/fixtures/api/rule_status.yml", "test/fixtures/api/rules_for_domain.yml", "test/fixtures/api/rules_for_domain_by_component.yml", "test/fixtures/api/save_group.yml", "test/fixtures/api/system_properties.yml", "test/fixtures/api/system_properties_create.yml", "test/fixtures/api/system_properties_element.yml", "test/fixtures/api/test_domain.yml", "test/fixtures/api/update_account_properties.yml", "test/fixtures/api/update_accounts_group_scope.yml", "test/fixtures/api/update_accounts_properties_scope.yml", "test/fixtures/api/update_directory.yml", "test/fixtures/api/update_rule.yml", "test/fixtures/api/update_user.yml", "test/fixtures/api/user_domains.yml", "test/fixtures/api/users_for_domain.yml", "test/fixtures/api/validate_user_credential.yml", "test/fixtures/domain.rb", "test/helper.rb", "test/test_directories.rb", "test/test_domain.rb", "test/test_dto.rb", "test/test_emailsync.rb", "test/test_feature.rb", "test/test_groups.rb", "test/test_mxhero_api.rb", "test/test_mxhero_api_response.rb", "test/test_pst-converter.rb", "test/test_resource.rb"]
|
15
15
|
s.homepage = "http://github.com/mxhero/mxhero-api"
|
16
16
|
s.licenses = ["GPL-3"]
|
17
17
|
s.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
18
18
|
s.rubygems_version = "2.5.1"
|
19
19
|
s.summary = "A MxHero API client for ruby"
|
20
|
-
s.test_files = ["test/fixtures/api/account_properties.yml", "test/fixtures/api/account_properties_not_found.yml", "test/fixtures/api/accounts.yml", "test/fixtures/api/accounts_filtered.yml", "test/fixtures/api/accounts_from_domain.yml", "test/fixtures/api/accounts_from_domain_paginated.yml", "test/fixtures/api/accounts_without_group.yml", "test/fixtures/api/add_an_inexistent_account_to_group.yml", "test/fixtures/api/add_and_remove_account.yml", "test/fixtures/api/add_feature.yml", "test/fixtures/api/all_groups.yml", "test/fixtures/api/associate_user_domain.yml", "test/fixtures/api/create_directory.yml", "test/fixtures/api/create_domain.yml", "test/fixtures/api/create_rule_for_domain.yml", "test/fixtures/api/create_user.yml", "test/fixtures/api/delete_directory.yml", "test/fixtures/api/delete_group.yml", "test/fixtures/api/delete_rule.yml", "test/fixtures/api/domain_by_id.yml", "test/fixtures/api/domain_by_id_not_found.yml", "test/fixtures/api/domain_rule.yml", "test/fixtures/api/domains.yml", "test/fixtures/api/fetch_directory.yml", "test/fixtures/api/fetch_user.yml", "test/fixtures/api/ldap_info.yml", "test/fixtures/api/move_to_trial.yml", "test/fixtures/api/pst_inactive_tasks.yml", "test/fixtures/api/refresh_directory.yml", "test/fixtures/api/remove_account_from_group_twice.yml", "test/fixtures/api/remove_inexistente_account_from_group.yml", "test/fixtures/api/rule_status.yml", "test/fixtures/api/rules_for_domain.yml", "test/fixtures/api/rules_for_domain_by_component.yml", "test/fixtures/api/save_group.yml", "test/fixtures/api/system_properties.yml", "test/fixtures/api/system_properties_create.yml", "test/fixtures/api/system_properties_element.yml", "test/fixtures/api/test_domain.yml", "test/fixtures/api/update_account_properties.yml", "test/fixtures/api/update_accounts_group_scope.yml", "test/fixtures/api/update_accounts_properties_scope.yml", "test/fixtures/api/update_directory.yml", "test/fixtures/api/update_rule.yml", "test/fixtures/api/update_user.yml", "test/fixtures/api/user_domains.yml", "test/fixtures/api/users_for_domain.yml", "test/fixtures/api/validate_user_credential.yml", "test/fixtures/domain.rb", "test/helper.rb", "test/test_directories.rb", "test/test_domain.rb", "test/test_dto.rb", "test/test_feature.rb", "test/test_groups.rb", "test/test_mxhero_api.rb", "test/test_mxhero_api_response.rb", "test/test_pst-converter.rb", "test/test_resource.rb"]
|
20
|
+
s.test_files = ["test/fixtures/api/account_properties.yml", "test/fixtures/api/account_properties_not_found.yml", "test/fixtures/api/accounts.yml", "test/fixtures/api/accounts_filtered.yml", "test/fixtures/api/accounts_from_domain.yml", "test/fixtures/api/accounts_from_domain_paginated.yml", "test/fixtures/api/accounts_without_group.yml", "test/fixtures/api/add_an_inexistent_account_to_group.yml", "test/fixtures/api/add_and_remove_account.yml", "test/fixtures/api/add_feature.yml", "test/fixtures/api/all_groups.yml", "test/fixtures/api/associate_user_domain.yml", "test/fixtures/api/create_directory.yml", "test/fixtures/api/create_domain.yml", "test/fixtures/api/create_rule_for_domain.yml", "test/fixtures/api/create_user.yml", "test/fixtures/api/delete_directory.yml", "test/fixtures/api/delete_group.yml", "test/fixtures/api/delete_rule.yml", "test/fixtures/api/domain_by_id.yml", "test/fixtures/api/domain_by_id_not_found.yml", "test/fixtures/api/domain_rule.yml", "test/fixtures/api/domains.yml", "test/fixtures/api/emailsync_delete.yml", "test/fixtures/api/emailsync_fetch_all.yml", "test/fixtures/api/emailsync_task_by_id.yml", "test/fixtures/api/fetch_directory.yml", "test/fixtures/api/fetch_user.yml", "test/fixtures/api/ldap_info.yml", "test/fixtures/api/move_to_trial.yml", "test/fixtures/api/pst_inactive_tasks.yml", "test/fixtures/api/refresh_directory.yml", "test/fixtures/api/remove_account_from_group_twice.yml", "test/fixtures/api/remove_inexistente_account_from_group.yml", "test/fixtures/api/rule_status.yml", "test/fixtures/api/rules_for_domain.yml", "test/fixtures/api/rules_for_domain_by_component.yml", "test/fixtures/api/save_group.yml", "test/fixtures/api/system_properties.yml", "test/fixtures/api/system_properties_create.yml", "test/fixtures/api/system_properties_element.yml", "test/fixtures/api/test_domain.yml", "test/fixtures/api/update_account_properties.yml", "test/fixtures/api/update_accounts_group_scope.yml", "test/fixtures/api/update_accounts_properties_scope.yml", "test/fixtures/api/update_directory.yml", "test/fixtures/api/update_rule.yml", "test/fixtures/api/update_user.yml", "test/fixtures/api/user_domains.yml", "test/fixtures/api/users_for_domain.yml", "test/fixtures/api/validate_user_credential.yml", "test/fixtures/domain.rb", "test/helper.rb", "test/test_directories.rb", "test/test_domain.rb", "test/test_dto.rb", "test/test_emailsync.rb", "test/test_feature.rb", "test/test_groups.rb", "test/test_mxhero_api.rb", "test/test_mxhero_api_response.rb", "test/test_pst-converter.rb", "test/test_resource.rb"]
|
21
21
|
|
22
22
|
if s.respond_to? :specification_version then
|
23
23
|
s.specification_version = 4
|
@@ -0,0 +1,32 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: delete
|
5
|
+
uri: http://admin:password@test.mxhero.com/webapi/api/v1/emailsync/tesla.com/031ad948-8e56-4035-a976-aa6400b0b261
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- application/json
|
12
|
+
Content-Type:
|
13
|
+
- application/json
|
14
|
+
Authorization:
|
15
|
+
- Basic YWRtaW46cGFzc3dvcmQ=
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Server:
|
22
|
+
- Apache-Coyote/1.1
|
23
|
+
Content-Length:
|
24
|
+
- '0'
|
25
|
+
Date:
|
26
|
+
- Tue, 05 Jul 2016 14:56:09 GMT
|
27
|
+
body:
|
28
|
+
encoding: UTF-8
|
29
|
+
string: ''
|
30
|
+
http_version:
|
31
|
+
recorded_at: Tue, 05 Jul 2016 14:56:09 GMT
|
32
|
+
recorded_with: VCR 2.5.0
|
@@ -0,0 +1,34 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://admin:password@test.mxhero.com/webapi/api/v1/emailsync/tesla.com/
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- application/json
|
12
|
+
Content-Type:
|
13
|
+
- application/json
|
14
|
+
Authorization:
|
15
|
+
- Basic YWRtaW46cGFzc3dvcmQ=
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Server:
|
22
|
+
- Apache-Coyote/1.1
|
23
|
+
Content-Type:
|
24
|
+
- application/json
|
25
|
+
Transfer-Encoding:
|
26
|
+
- chunked
|
27
|
+
Date:
|
28
|
+
- Tue, 05 Jul 2016 14:22:17 GMT
|
29
|
+
body:
|
30
|
+
encoding: UTF-8
|
31
|
+
string: '[{"taskId":"031ad948-8e56-4035-a976-aa6400b0b261","domain":"mxhero.com","createdAt":1467124478933,"updatedAt":1467124497158,"status":"finished","type":"normal","lastErrorCode":null,"configuration":{"type":"normal","accounts":["jproyo@mxhero.com"],"rateLimit":20,"maxErrorTryPerAccount":10,"period":{"repeatEverySeconds":null,"until":null},"imap":{"type":"gapps","credentials":{},"filterSearch":{"date":{"from":1467072000000,"to":1467158400000},"fromTo":{"upload":[],"ignore":[]},"folders":{"inclusion":["Inbox"],"exclusion":[]}}},"cloudStorage":{"adminAccount":"jproyo@mxhero.com","storageAccount":"jproyo@mxhero.com","appAuthId":null,"storageType":"box","mappingAccounts":[]},"folderStorage":{"matchers":[],"folderStructure":"mail2Cloud/EmailSync/Integration/Test/${subject}","attachmentsSubfolder":null,"originalEmailSubfolder":null,"bodySubfolder":null},"security":{"scope":"anyone","canDownload":true,"expireAccessInSeconds":0,"entity":null,"overwrite":false},"assets":{"doNotOverwrite":false,"emails":{"deleteOriginal":false,"patternFile":"${subject}","storageFormats":[{"format":"pdf","subfolder":"email","eml":false,"pdf":true},{"format":"eml","subfolder":"body","eml":true,"pdf":false}]},"documents":{"store":true,"sizeInBytes":null,"replaceByLinks":true,"contentTypes":[],"extensions":[],"subfolder":"attachments","contentTypeImagesSet":false}},"notification":{"onError":true,"onSuccess":true,"mailAddress":"jproyo@mxhero.com","source":"dashboard-3.0"}},"wasNotified":true,"amountEmailsProcessed":2,"amountFilesSync":6,"amountEmailsError":0,"amountAccounts":1,"amountAccountsRunning":-1,"amountAccountsFinished":1,"amountAccountsError":0,"amountAccountsFinishedWithError":0,"notRecursiveOrPeriodFinished":true,"recursive":false,"finished":true},{"taskId":"03fbf292-78e3-4129-a760-c19ff17e48d5","domain":"mxhero.com","createdAt":1467372097672,"updatedAt":1467372163053,"status":"finished","type":"normal","lastErrorCode":null,"configuration":{"type":"normal","accounts":["jproyo@mxhero.com"],"rateLimit":20,"maxErrorTryPerAccount":10,"period":{"repeatEverySeconds":null,"until":null},"imap":{"type":"gapps","credentials":{},"filterSearch":{"date":{"from":1467072000000,"to":1467158400000},"fromTo":{"upload":[],"ignore":[]},"folders":{"inclusion":["Inbox"],"exclusion":[]}}},"cloudStorage":{"adminAccount":"jproyo@mxhero.com","storageAccount":"jproyo@mxhero.com","appAuthId":null,"storageType":"box","mappingAccounts":[]},"folderStorage":{"matchers":[],"folderStructure":"mail2Cloud/EmailSync/Integration/Test/${subject}","attachmentsSubfolder":null,"originalEmailSubfolder":null,"bodySubfolder":null},"security":{"scope":"anyone","canDownload":true,"expireAccessInSeconds":0,"entity":null,"overwrite":false},"assets":{"doNotOverwrite":false,"emails":{"deleteOriginal":false,"patternFile":"${subject}","storageFormats":[{"format":"pdf","subfolder":"email","eml":false,"pdf":true},{"format":"eml","subfolder":"body","eml":true,"pdf":false}]},"documents":{"store":true,"sizeInBytes":null,"replaceByLinks":true,"contentTypes":[],"extensions":[],"subfolder":"attachments","contentTypeImagesSet":false}},"notification":{"onError":true,"onSuccess":true,"mailAddress":"jproyo@mxhero.com","source":"dashboard-3.0"}},"wasNotified":true,"amountEmailsProcessed":2,"amountFilesSync":6,"amountEmailsError":0,"amountAccounts":1,"amountAccountsRunning":0,"amountAccountsFinished":1,"amountAccountsError":0,"amountAccountsFinishedWithError":0,"notRecursiveOrPeriodFinished":true,"recursive":false,"finished":true},{"taskId":"18d9a394-daf8-413b-829f-0b4ac460c7b8","domain":"mxhero.com","createdAt":1467642415355,"updatedAt":1467642441184,"status":"finished","type":"normal","lastErrorCode":null,"configuration":{"type":"normal","accounts":["jproyo@mxhero.com"],"rateLimit":20,"maxErrorTryPerAccount":10,"period":{"repeatEverySeconds":null,"until":null},"imap":{"type":"gapps","credentials":{},"filterSearch":{"date":{"from":1467590400000,"to":1467676800000},"fromTo":{"upload":[],"ignore":[]},"folders":{"inclusion":["Inbox"],"exclusion":[]}}},"cloudStorage":{"adminAccount":"jproyo@mxhero.com","storageAccount":"jproyo@mxhero.com","appAuthId":null,"storageType":"box","mappingAccounts":[]},"folderStorage":{"matchers":[],"folderStructure":"mail2Cloud/EmailSync/Integration/Test/${subject}","attachmentsSubfolder":null,"originalEmailSubfolder":null,"bodySubfolder":null},"security":{"scope":"anyone","canDownload":true,"expireAccessInSeconds":0,"entity":null,"overwrite":false},"assets":{"doNotOverwrite":false,"emails":{"deleteOriginal":false,"patternFile":"${subject}","storageFormats":[{"format":"pdf","subfolder":"email","eml":false,"pdf":true},{"format":"eml","subfolder":"body","eml":true,"pdf":false}]},"documents":{"store":true,"sizeInBytes":null,"replaceByLinks":true,"contentTypes":[],"extensions":[],"subfolder":"attachments","contentTypeImagesSet":false}},"notification":{"onError":true,"onSuccess":true,"mailAddress":"jproyo@mxhero.com","source":"dashboard-3.0"}},"wasNotified":true,"amountEmailsProcessed":3,"amountFilesSync":9,"amountEmailsError":0,"amountAccounts":1,"amountAccountsRunning":0,"amountAccountsFinished":1,"amountAccountsError":0,"amountAccountsFinishedWithError":0,"notRecursiveOrPeriodFinished":true,"recursive":false,"finished":true},{"taskId":"19f38e6e-efc5-41d0-a4cc-fced3b0086c1","domain":"mxhero.com","createdAt":1467065612707,"updatedAt":1467103779917,"status":"finished","type":"normal","lastErrorCode":null,"configuration":{"type":"normal","accounts":["jproyo@mxhero.com"],"rateLimit":20,"maxErrorTryPerAccount":10,"period":{"repeatEverySeconds":null,"until":null},"imap":{"type":"gapps","credentials":{},"filterSearch":{"date":{"from":1466024400000,"to":1466035200000},"fromTo":{"upload":[],"ignore":[]},"folders":{"inclusion":["Inbox"],"exclusion":[]}}},"cloudStorage":{"adminAccount":null,"storageAccount":null,"appAuthId":null,"storageType":"drive","mappingAccounts":[]},"folderStorage":{"matchers":[],"folderStructure":"mail2Cloud/EmailSync/Integration/Test/${subject}","attachmentsSubfolder":null,"originalEmailSubfolder":null,"bodySubfolder":null},"security":{"scope":"anyone","canDownload":true,"expireAccessInSeconds":0,"entity":null,"overwrite":false},"assets":{"doNotOverwrite":false,"emails":null,"documents":null},"notification":{"onError":true,"onSuccess":true,"mailAddress":"jproyo@mxhero.com","source":"dashboard-3.0"}},"wasNotified":true,"amountEmailsProcessed":7,"amountFilesSync":0,"amountEmailsError":0,"amountAccounts":1,"amountAccountsRunning":-10902,"amountAccountsFinished":10902,"amountAccountsError":0,"amountAccountsFinishedWithError":0,"notRecursiveOrPeriodFinished":true,"recursive":false,"finished":true},{"taskId":"1d0e649b-862f-44d0-9398-54bbf0357a25","domain":"mxhero.com","createdAt":1467638073639,"updatedAt":1467638093176,"status":"finished","type":"normal","lastErrorCode":null,"configuration":{"type":"normal","accounts":["jproyo@mxhero.com"],"rateLimit":20,"maxErrorTryPerAccount":10,"period":{"repeatEverySeconds":null,"until":null},"imap":{"type":"gapps","credentials":{},"filterSearch":{"date":{"from":1467590400000,"to":1467676800000},"fromTo":{"upload":[],"ignore":[]},"folders":{"inclusion":["Inbox"],"exclusion":[]}}},"cloudStorage":{"adminAccount":"jproyo@mxhero.com","storageAccount":"jproyo@mxhero.com","appAuthId":null,"storageType":"box","mappingAccounts":[]},"folderStorage":{"matchers":[],"folderStructure":"mail2Cloud/EmailSync/Integration/Test/${subject}","attachmentsSubfolder":null,"originalEmailSubfolder":null,"bodySubfolder":null},"security":{"scope":"anyone","canDownload":true,"expireAccessInSeconds":0,"entity":null,"overwrite":false},"assets":{"doNotOverwrite":false,"emails":{"deleteOriginal":false,"patternFile":"${subject}","storageFormats":[{"format":"pdf","subfolder":"email","eml":false,"pdf":true},{"format":"eml","subfolder":"body","eml":true,"pdf":false}]},"documents":{"store":true,"sizeInBytes":null,"replaceByLinks":true,"contentTypes":[],"extensions":[],"subfolder":"attachments","contentTypeImagesSet":false}},"notification":{"onError":true,"onSuccess":true,"mailAddress":"jproyo@mxhero.com","source":"dashboard-3.0"}},"wasNotified":true,"amountEmailsProcessed":2,"amountFilesSync":5,"amountEmailsError":0,"amountAccounts":1,"amountAccountsRunning":0,"amountAccountsFinished":1,"amountAccountsError":0,"amountAccountsFinishedWithError":0,"notRecursiveOrPeriodFinished":true,"recursive":false,"finished":true},{"taskId":"22990a3f-bcec-453f-8b22-5f69f4f3ced0","domain":"mxhero.com","createdAt":1467640097642,"updatedAt":1467640115294,"status":"finished","type":"normal","lastErrorCode":null,"configuration":{"type":"normal","accounts":["jproyo@mxhero.com"],"rateLimit":20,"maxErrorTryPerAccount":10,"period":{"repeatEverySeconds":null,"until":null},"imap":{"type":"gapps","credentials":{},"filterSearch":{"date":{"from":1467590400000,"to":1467676800000},"fromTo":{"upload":[],"ignore":[]},"folders":{"inclusion":["Inbox"],"exclusion":[]}}},"cloudStorage":{"adminAccount":"jproyo@mxhero.com","storageAccount":"jproyo@mxhero.com","appAuthId":null,"storageType":"box","mappingAccounts":[]},"folderStorage":{"matchers":[],"folderStructure":"mail2Cloud/EmailSync/Integration/Test/${subject}","attachmentsSubfolder":null,"originalEmailSubfolder":null,"bodySubfolder":null},"security":{"scope":"anyone","canDownload":true,"expireAccessInSeconds":0,"entity":null,"overwrite":false},"assets":{"doNotOverwrite":false,"emails":{"deleteOriginal":false,"patternFile":"${subject}","storageFormats":[{"format":"pdf","subfolder":"email","eml":false,"pdf":true},{"format":"eml","subfolder":"body","eml":true,"pdf":false}]},"documents":{"store":true,"sizeInBytes":null,"replaceByLinks":true,"contentTypes":[],"extensions":[],"subfolder":"attachments","contentTypeImagesSet":false}},"notification":{"onError":true,"onSuccess":true,"mailAddress":"jproyo@mxhero.com","source":"dashboard-3.0"}},"wasNotified":true,"amountEmailsProcessed":1,"amountFilesSync":3,"amountEmailsError":0,"amountAccounts":1,"amountAccountsRunning":0,"amountAccountsFinished":1,"amountAccountsError":0,"amountAccountsFinishedWithError":0,"notRecursiveOrPeriodFinished":true,"recursive":false,"finished":true},{"taskId":"2dcf7863-47ef-401b-8f9f-0ad3d03d97ab","domain":"mxhero.com","createdAt":1467105624243,"updatedAt":1467105657525,"status":"finished","type":"normal","lastErrorCode":null,"configuration":{"type":"normal","accounts":["jproyo@mxhero.com"],"rateLimit":20,"maxErrorTryPerAccount":10,"period":{"repeatEverySeconds":null,"until":null},"imap":{"type":"gapps","credentials":{},"filterSearch":{"date":{"from":1466024400000,"to":1466035200000},"fromTo":{"upload":[],"ignore":[]},"folders":{"inclusion":["Inbox"],"exclusion":[]}}},"cloudStorage":{"adminAccount":null,"storageAccount":null,"appAuthId":null,"storageType":"drive","mappingAccounts":[]},"folderStorage":{"matchers":[],"folderStructure":"mail2Cloud/EmailSync/Integration/Test/${subject}","attachmentsSubfolder":null,"originalEmailSubfolder":null,"bodySubfolder":null},"security":{"scope":"anyone","canDownload":true,"expireAccessInSeconds":0,"entity":null,"overwrite":false},"assets":{"doNotOverwrite":false,"emails":{"deleteOriginal":false,"patternFile":"${subject}","storageFormats":[{"format":"pdf","subfolder":"email","eml":false,"pdf":true},{"format":"eml","subfolder":"body","eml":true,"pdf":false}]},"documents":{"store":true,"sizeInBytes":12321,"replaceByLinks":false,"contentTypes":["image/*","application/*"],"extensions":["pdf","xls"],"subfolder":"attachments","contentTypeImagesSet":true}},"notification":{"onError":true,"onSuccess":true,"mailAddress":"jproyo@mxhero.com","source":"dashboard-3.0"}},"wasNotified":true,"amountEmailsProcessed":7,"amountFilesSync":14,"amountEmailsError":0,"amountAccounts":1,"amountAccountsRunning":-1,"amountAccountsFinished":1,"amountAccountsError":0,"amountAccountsFinishedWithError":0,"notRecursiveOrPeriodFinished":true,"recursive":false,"finished":true},{"taskId":"2f5364b4-f287-429a-add7-896cfd57d409","domain":"mxhero.com","createdAt":1467648507256,"updatedAt":1467650499318,"status":"request_pause","type":"recursive","lastErrorCode":null,"configuration":{"type":"recursive","accounts":["maxidr@mxhero.com","jproyo@mxhero.com","mmarmol@mxhero.com"],"rateLimit":20,"maxErrorTryPerAccount":10,"period":{"repeatEverySeconds":null,"until":null},"imap":{"type":"gapps","credentials":{},"filterSearch":{"date":{"from":1467590400000,"to":null},"fromTo":{"upload":[],"ignore":[]},"folders":{"inclusion":["Inbox"],"exclusion":[]}}},"cloudStorage":{"adminAccount":"jproyo@mxhero.com","storageAccount":null,"appAuthId":null,"storageType":"box","mappingAccounts":[{"imapAccount":"jproyo@mxhero.com","storageAccount":"jproyo@mxhero.com"},{"imapAccount":"mmarmol@mxhero.com","storageAccount":"mmarmol@mxhero.com"},{"imapAccount":"maxidr@mxhero.com","storageAccount":"maxidr@mxhero.com"}]},"folderStorage":{"matchers":[],"folderStructure":"mail2Cloud/EmailSync/Integration/Test/${subject}","attachmentsSubfolder":null,"originalEmailSubfolder":null,"bodySubfolder":null},"security":{"scope":"anyone","canDownload":true,"expireAccessInSeconds":0,"entity":null,"overwrite":false},"assets":{"doNotOverwrite":false,"emails":{"deleteOriginal":false,"patternFile":"${subject}","storageFormats":[{"format":"pdf","subfolder":"email","eml":false,"pdf":true},{"format":"eml","subfolder":"body","eml":true,"pdf":false}]},"documents":{"store":true,"sizeInBytes":null,"replaceByLinks":false,"contentTypes":[],"extensions":[],"subfolder":"attachments","contentTypeImagesSet":false}},"notification":{"onError":true,"onSuccess":true,"mailAddress":"jproyo@mxhero.com","source":"dashboard-3.0"}},"wasNotified":false,"amountEmailsProcessed":39,"amountFilesSync":81,"amountEmailsError":0,"amountAccounts":3,"amountAccountsRunning":3,"amountAccountsFinished":0,"amountAccountsError":0,"amountAccountsFinishedWithError":0,"notRecursiveOrPeriodFinished":false,"recursive":true,"finished":false},{"taskId":"305ffd47-a163-4dae-a793-9d4b6818f164","domain":"mxhero.com","createdAt":1467643248442,"updatedAt":1467643318393,"status":"finished","type":"normal","lastErrorCode":null,"configuration":{"type":"normal","accounts":["maxidr@mxhero.com","jproyo@mxhero.com","mmarmol@mxhero.com"],"rateLimit":20,"maxErrorTryPerAccount":10,"period":{"repeatEverySeconds":null,"until":null},"imap":{"type":"gapps","credentials":{},"filterSearch":{"date":{"from":1467590400000,"to":1467676800000},"fromTo":{"upload":[],"ignore":[]},"folders":{"inclusion":["Inbox"],"exclusion":[]}}},"cloudStorage":{"adminAccount":"jproyo@mxhero.com","storageAccount":null,"appAuthId":null,"storageType":"box","mappingAccounts":[{"imapAccount":"jproyo@mxhero.com","storageAccount":"jproyo@mxhero.com"},{"imapAccount":"mmarmol@mxhero.com","storageAccount":"mmarmol@mxhero.com"},{"imapAccount":"maxidr@mxhero.com","storageAccount":"maxidr@mxhero.com"}]},"folderStorage":{"matchers":[],"folderStructure":"mail2Cloud/EmailSync/Integration/Test/${subject}","attachmentsSubfolder":null,"originalEmailSubfolder":null,"bodySubfolder":null},"security":{"scope":"anyone","canDownload":true,"expireAccessInSeconds":0,"entity":null,"overwrite":false},"assets":{"doNotOverwrite":false,"emails":{"deleteOriginal":false,"patternFile":"${subject}","storageFormats":[{"format":"pdf","subfolder":"email","eml":false,"pdf":true},{"format":"eml","subfolder":"body","eml":true,"pdf":false}]},"documents":{"store":true,"sizeInBytes":null,"replaceByLinks":false,"contentTypes":[],"extensions":[],"subfolder":"attachments","contentTypeImagesSet":false}},"notification":{"onError":true,"onSuccess":true,"mailAddress":"jproyo@mxhero.com","source":"dashboard-3.0"}},"wasNotified":true,"amountEmailsProcessed":46,"amountFilesSync":95,"amountEmailsError":0,"amountAccounts":3,"amountAccountsRunning":0,"amountAccountsFinished":3,"amountAccountsError":0,"amountAccountsFinishedWithError":0,"notRecursiveOrPeriodFinished":true,"recursive":false,"finished":true},{"taskId":"32e18726-6490-4e28-b177-c7da379c7d68","domain":"mxhero.com","createdAt":1467640708490,"updatedAt":1467640751789,"status":"finished","type":"normal","lastErrorCode":null,"configuration":{"type":"normal","accounts":["jproyo@mxhero.com"],"rateLimit":20,"maxErrorTryPerAccount":10,"period":{"repeatEverySeconds":null,"until":null},"imap":{"type":"gapps","credentials":{},"filterSearch":{"date":{"from":1467590400000,"to":1467676800000},"fromTo":{"upload":[],"ignore":[]},"folders":{"inclusion":["Inbox"],"exclusion":[]}}},"cloudStorage":{"adminAccount":"jproyo@mxhero.com","storageAccount":"jproyo@mxhero.com","appAuthId":null,"storageType":"box","mappingAccounts":[]},"folderStorage":{"matchers":[],"folderStructure":"mail2Cloud/EmailSync/Integration/Test/${subject}","attachmentsSubfolder":null,"originalEmailSubfolder":null,"bodySubfolder":null},"security":{"scope":"anyone","canDownload":true,"expireAccessInSeconds":0,"entity":null,"overwrite":false},"assets":{"doNotOverwrite":false,"emails":{"deleteOriginal":false,"patternFile":"${subject}","storageFormats":[{"format":"pdf","subfolder":"email","eml":false,"pdf":true},{"format":"eml","subfolder":"body","eml":true,"pdf":false}]},"documents":{"store":true,"sizeInBytes":null,"replaceByLinks":true,"contentTypes":[],"extensions":[],"subfolder":"attachments","contentTypeImagesSet":false}},"notification":{"onError":true,"onSuccess":true,"mailAddress":"jproyo@mxhero.com","source":"dashboard-3.0"}},"wasNotified":true,"amountEmailsProcessed":3,"amountFilesSync":9,"amountEmailsError":0,"amountAccounts":1,"amountAccountsRunning":0,"amountAccountsFinished":1,"amountAccountsError":0,"amountAccountsFinishedWithError":0,"notRecursiveOrPeriodFinished":true,"recursive":false,"finished":true}]'
|
32
|
+
http_version:
|
33
|
+
recorded_at: Tue, 05 Jul 2016 14:22:18 GMT
|
34
|
+
recorded_with: VCR 2.5.0
|
@@ -0,0 +1,34 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://admin:password@test.mxhero.com/webapi/api/v1/emailsync/tesla.com/031ad948-8e56-4035-a976-aa6400b0b261
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- application/json
|
12
|
+
Content-Type:
|
13
|
+
- application/json
|
14
|
+
Authorization:
|
15
|
+
- Basic YWRtaW46cGFzc3dvcmQ=
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Server:
|
22
|
+
- Apache-Coyote/1.1
|
23
|
+
Content-Type:
|
24
|
+
- application/json
|
25
|
+
Transfer-Encoding:
|
26
|
+
- chunked
|
27
|
+
Date:
|
28
|
+
- Tue, 05 Jul 2016 14:33:04 GMT
|
29
|
+
body:
|
30
|
+
encoding: UTF-8
|
31
|
+
string: '{"taskId":"031ad948-8e56-4035-a976-aa6400b0b261","domain":"mxhero.com","createdAt":1467124478933,"updatedAt":1467124497158,"status":"finished","type":"normal","lastErrorCode":null,"configuration":{"type":"normal","accounts":["jproyo@mxhero.com"],"rateLimit":20,"maxErrorTryPerAccount":10,"period":{"repeatEverySeconds":null,"until":null},"imap":{"type":"gapps","credentials":{},"filterSearch":{"date":{"from":1467072000000,"to":1467158400000},"fromTo":{"upload":[],"ignore":[]},"folders":{"inclusion":["Inbox"],"exclusion":[]}}},"cloudStorage":{"adminAccount":"jproyo@mxhero.com","storageAccount":"jproyo@mxhero.com","appAuthId":null,"storageType":"box","mappingAccounts":[]},"folderStorage":{"matchers":[],"folderStructure":"mail2Cloud/EmailSync/Integration/Test/${subject}","attachmentsSubfolder":null,"originalEmailSubfolder":null,"bodySubfolder":null},"security":{"scope":"anyone","canDownload":true,"expireAccessInSeconds":0,"entity":null,"overwrite":false},"assets":{"doNotOverwrite":false,"emails":{"deleteOriginal":false,"patternFile":"${subject}","storageFormats":[{"format":"pdf","subfolder":"email","eml":false,"pdf":true},{"format":"eml","subfolder":"body","eml":true,"pdf":false}]},"documents":{"store":true,"sizeInBytes":null,"replaceByLinks":true,"contentTypes":[],"extensions":[],"subfolder":"attachments","contentTypeImagesSet":false}},"notification":{"onError":true,"onSuccess":true,"mailAddress":"jproyo@mxhero.com","source":"dashboard-3.0"}},"wasNotified":true,"amountEmailsProcessed":2,"amountFilesSync":6,"amountEmailsError":0,"amountAccounts":1,"amountAccountsRunning":-1,"amountAccountsFinished":1,"amountAccountsError":0,"amountAccountsFinishedWithError":0,"notRecursiveOrPeriodFinished":true,"recursive":false,"finished":true}'
|
32
|
+
http_version:
|
33
|
+
recorded_at: Tue, 05 Jul 2016 14:33:03 GMT
|
34
|
+
recorded_with: VCR 2.5.0
|
data/test/helper.rb
CHANGED
@@ -12,7 +12,7 @@ require_relative '../lib/mxhero-api'
|
|
12
12
|
# Load fixtures
|
13
13
|
Dir["#{File.dirname(__FILE__)}/fixtures/**/*.rb"].each { |rb| require rb }
|
14
14
|
|
15
|
-
TEST_API_DOMAIN = 'tesla.com'
|
15
|
+
TEST_API_DOMAIN = ENV['TEST_API_DOMAIN'] || 'tesla.com'
|
16
16
|
TEST_API_URL = ENV['TEST_API_URL'] || 'http://test.mxhero.com/webapi/api/v1'
|
17
17
|
TEST_API_USER = 'admin'
|
18
18
|
TEST_API_PASSWORD = ENV['TEST_API_PASSWORD'] || 'password'
|
@@ -0,0 +1,169 @@
|
|
1
|
+
require_relative 'helper'
|
2
|
+
|
3
|
+
class EmailSyncTest < Minitest::Test
|
4
|
+
def setup
|
5
|
+
@emailsync = MxHero::API::EmailSync.new(username: TEST_API_USER,
|
6
|
+
password: TEST_API_PASSWORD, verbose: false,
|
7
|
+
api_url: TEST_API_URL)
|
8
|
+
end
|
9
|
+
|
10
|
+
def domain
|
11
|
+
TEST_API_DOMAIN
|
12
|
+
end
|
13
|
+
|
14
|
+
=begin
|
15
|
+
|
16
|
+
[{
|
17
|
+
taskId: "031ad948-8e56-4035-a976-aa6400b0b261",
|
18
|
+
domain: "mxhero.com",
|
19
|
+
createdAt: 1467124478933,
|
20
|
+
updatedAt: 1467124497158,
|
21
|
+
status: "finished",
|
22
|
+
type: "normal",
|
23
|
+
lastErrorCode: null,
|
24
|
+
configuration: {
|
25
|
+
type: "normal",
|
26
|
+
accounts: [
|
27
|
+
"jproyo@mxhero.com"
|
28
|
+
],
|
29
|
+
rateLimit: 20,
|
30
|
+
maxErrorTryPerAccount: 10,
|
31
|
+
period: {
|
32
|
+
repeatEverySeconds: null,
|
33
|
+
until: null
|
34
|
+
},
|
35
|
+
imap: {
|
36
|
+
type: "gapps",
|
37
|
+
credentials: {},
|
38
|
+
filterSearch: {
|
39
|
+
date: {
|
40
|
+
from: 1467072000000,
|
41
|
+
to: 1467158400000
|
42
|
+
},
|
43
|
+
fromTo: {
|
44
|
+
upload: [],
|
45
|
+
ignore: []
|
46
|
+
},
|
47
|
+
folders: {
|
48
|
+
inclusion: [
|
49
|
+
"Inbox"
|
50
|
+
],
|
51
|
+
exclusion: []
|
52
|
+
}
|
53
|
+
}
|
54
|
+
},
|
55
|
+
cloudStorage: {
|
56
|
+
adminAccount: "jproyo@mxhero.com",
|
57
|
+
storageAccount: "jproyo@mxhero.com",
|
58
|
+
appAuthId: null,
|
59
|
+
storageType: "box",
|
60
|
+
mappingAccounts: []
|
61
|
+
},
|
62
|
+
folderStorage: {
|
63
|
+
matchers: [],
|
64
|
+
folderStructure: "mail2Cloud/EmailSync/Integration/Test/${subject}",
|
65
|
+
attachmentsSubfolder: null,
|
66
|
+
originalEmailSubfolder: null,
|
67
|
+
bodySubfolder: null
|
68
|
+
},
|
69
|
+
security: {
|
70
|
+
scope: "anyone",
|
71
|
+
canDownload: true,
|
72
|
+
expireAccessInSeconds: 0,
|
73
|
+
entity: null,
|
74
|
+
overwrite: false
|
75
|
+
},
|
76
|
+
assets: {
|
77
|
+
doNotOverwrite: false,
|
78
|
+
emails: {
|
79
|
+
deleteOriginal: false,
|
80
|
+
patternFile: "${subject}",
|
81
|
+
storageFormats: [{
|
82
|
+
format: "pdf",
|
83
|
+
subfolder: "email",
|
84
|
+
eml: false,
|
85
|
+
pdf: true
|
86
|
+
}, {
|
87
|
+
format: "eml",
|
88
|
+
subfolder: "body",
|
89
|
+
eml: true,
|
90
|
+
pdf: false
|
91
|
+
}]
|
92
|
+
},
|
93
|
+
documents: {
|
94
|
+
store: true,
|
95
|
+
sizeInBytes: null,
|
96
|
+
replaceByLinks: true,
|
97
|
+
contentTypes: [],
|
98
|
+
extensions: [],
|
99
|
+
subfolder: "attachments",
|
100
|
+
contentTypeImagesSet: false
|
101
|
+
}
|
102
|
+
},
|
103
|
+
notification: {
|
104
|
+
onError: true,
|
105
|
+
onSuccess: true,
|
106
|
+
mailAddress: "jproyo@mxhero.com",
|
107
|
+
source: "dashboard-3.0"
|
108
|
+
}
|
109
|
+
},
|
110
|
+
wasNotified: true,
|
111
|
+
amountEmailsProcessed: 2,
|
112
|
+
amountFilesSync: 6,
|
113
|
+
amountEmailsError: 0,
|
114
|
+
amountAccounts: 1,
|
115
|
+
amountAccountsRunning: -1,
|
116
|
+
amountAccountsFinished: 1,
|
117
|
+
amountAccountsError: 0,
|
118
|
+
amountAccountsFinishedWithError: 0,
|
119
|
+
notRecursiveOrPeriodFinished: true,
|
120
|
+
recursive: false,
|
121
|
+
finished: true
|
122
|
+
}]
|
123
|
+
|
124
|
+
=end
|
125
|
+
|
126
|
+
def test_all
|
127
|
+
VCR.use_cassette('emailsync_fetch_all') do
|
128
|
+
response = @emailsync.all(domain)
|
129
|
+
assert response.success?
|
130
|
+
assert response.msg
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
def test_request_all
|
135
|
+
VCR.use_cassette('emailsync_fetch_all') do
|
136
|
+
response = @emailsync.request(domain, :get, '/')
|
137
|
+
assert response.ok?
|
138
|
+
assert response.content
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
def test_task_by_id
|
143
|
+
VCR.use_cassette('emailsync_task_by_id') do
|
144
|
+
response = @emailsync.task_by_id(domain, '031ad948-8e56-4035-a976-aa6400b0b261')
|
145
|
+
assert response.success?
|
146
|
+
assert response.msg
|
147
|
+
assert response.msg[:taskId] == '031ad948-8e56-4035-a976-aa6400b0b261'
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
def test_request_task_by_id
|
152
|
+
VCR.use_cassette('emailsync_task_by_id') do
|
153
|
+
response = @emailsync.request(domain, :get, '/031ad948-8e56-4035-a976-aa6400b0b261')
|
154
|
+
assert response.ok?
|
155
|
+
assert response.content
|
156
|
+
assert response.content.include? '"taskId":"031ad948-8e56-4035-a976-aa6400b0b261"'
|
157
|
+
end
|
158
|
+
end
|
159
|
+
|
160
|
+
def test_delete
|
161
|
+
VCR.use_cassette('emailsync_delete') do
|
162
|
+
response = @emailsync.delete(domain, '031ad948-8e56-4035-a976-aa6400b0b261')
|
163
|
+
assert response.success?
|
164
|
+
assert response.msg.empty?
|
165
|
+
assert_equal({}, response.msg)
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
169
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mxhero-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maximiliano Dello Russo
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-
|
13
|
+
date: 2016-07-07 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: vcr
|
@@ -74,6 +74,7 @@ files:
|
|
74
74
|
- lib/communication.rb
|
75
75
|
- lib/directories.rb
|
76
76
|
- lib/dto.rb
|
77
|
+
- lib/email-sync.rb
|
77
78
|
- lib/groups.rb
|
78
79
|
- lib/mxhero-api.rb
|
79
80
|
- lib/pst-converter.rb
|
@@ -107,6 +108,9 @@ files:
|
|
107
108
|
- test/fixtures/api/domain_by_id_not_found.yml
|
108
109
|
- test/fixtures/api/domain_rule.yml
|
109
110
|
- test/fixtures/api/domains.yml
|
111
|
+
- test/fixtures/api/emailsync_delete.yml
|
112
|
+
- test/fixtures/api/emailsync_fetch_all.yml
|
113
|
+
- test/fixtures/api/emailsync_task_by_id.yml
|
110
114
|
- test/fixtures/api/fetch_directory.yml
|
111
115
|
- test/fixtures/api/fetch_user.yml
|
112
116
|
- test/fixtures/api/ldap_info.yml
|
@@ -137,6 +141,7 @@ files:
|
|
137
141
|
- test/test_directories.rb
|
138
142
|
- test/test_domain.rb
|
139
143
|
- test/test_dto.rb
|
144
|
+
- test/test_emailsync.rb
|
140
145
|
- test/test_feature.rb
|
141
146
|
- test/test_groups.rb
|
142
147
|
- test/test_mxhero_api.rb
|
@@ -191,6 +196,9 @@ test_files:
|
|
191
196
|
- test/fixtures/api/domain_by_id_not_found.yml
|
192
197
|
- test/fixtures/api/domain_rule.yml
|
193
198
|
- test/fixtures/api/domains.yml
|
199
|
+
- test/fixtures/api/emailsync_delete.yml
|
200
|
+
- test/fixtures/api/emailsync_fetch_all.yml
|
201
|
+
- test/fixtures/api/emailsync_task_by_id.yml
|
194
202
|
- test/fixtures/api/fetch_directory.yml
|
195
203
|
- test/fixtures/api/fetch_user.yml
|
196
204
|
- test/fixtures/api/ldap_info.yml
|
@@ -221,6 +229,7 @@ test_files:
|
|
221
229
|
- test/test_directories.rb
|
222
230
|
- test/test_domain.rb
|
223
231
|
- test/test_dto.rb
|
232
|
+
- test/test_emailsync.rb
|
224
233
|
- test/test_feature.rb
|
225
234
|
- test/test_groups.rb
|
226
235
|
- test/test_mxhero_api.rb
|