mx-platform-ruby 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (260) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +6 -2
  3. data/Gemfile.lock +84 -0
  4. data/README.md +236 -33
  5. data/Rakefile +8 -9
  6. data/lib/mx-platform-ruby.rb +126 -35
  7. data/lib/mx-platform-ruby/api/mx_platform_api.rb +4917 -0
  8. data/lib/mx-platform-ruby/api_client.rb +395 -0
  9. data/lib/mx-platform-ruby/api_error.rb +57 -0
  10. data/lib/mx-platform-ruby/configuration.rb +276 -0
  11. data/lib/mx-platform-ruby/models/account.rb +569 -0
  12. data/lib/mx-platform-ruby/models/account_number.rb +281 -0
  13. data/lib/mx-platform-ruby/models/account_numbers_response_body.rb +229 -0
  14. data/lib/mx-platform-ruby/models/account_owner.rb +317 -0
  15. data/lib/mx-platform-ruby/models/account_owners_response_body.rb +229 -0
  16. data/lib/mx-platform-ruby/models/account_response_body.rb +218 -0
  17. data/lib/mx-platform-ruby/models/account_update_request.rb +218 -0
  18. data/lib/mx-platform-ruby/models/account_update_request_body.rb +218 -0
  19. data/lib/mx-platform-ruby/models/accounts_response_body.rb +229 -0
  20. data/lib/mx-platform-ruby/models/categories_response_body.rb +229 -0
  21. data/lib/mx-platform-ruby/models/category.rb +281 -0
  22. data/lib/mx-platform-ruby/models/category_create_request.rb +241 -0
  23. data/lib/mx-platform-ruby/models/category_create_request_body.rb +218 -0
  24. data/lib/mx-platform-ruby/models/category_response_body.rb +218 -0
  25. data/lib/mx-platform-ruby/models/category_update_request.rb +227 -0
  26. data/lib/mx-platform-ruby/models/category_update_request_body.rb +218 -0
  27. data/lib/mx-platform-ruby/models/challenge.rb +276 -0
  28. data/lib/mx-platform-ruby/models/challenge_image_options.rb +236 -0
  29. data/lib/mx-platform-ruby/models/challenge_options.rb +227 -0
  30. data/lib/mx-platform-ruby/models/challenges_response_body.rb +229 -0
  31. data/lib/mx-platform-ruby/models/connect_widget.rb +227 -0
  32. data/lib/mx-platform-ruby/models/connect_widget_request.rb +308 -0
  33. data/lib/mx-platform-ruby/models/connect_widget_request_body.rb +218 -0
  34. data/lib/mx-platform-ruby/models/connect_widget_response_body.rb +218 -0
  35. data/lib/mx-platform-ruby/models/credential.rb +254 -0
  36. data/lib/mx-platform-ruby/models/credential_request.rb +227 -0
  37. data/lib/mx-platform-ruby/models/credentials_response_body.rb +229 -0
  38. data/lib/mx-platform-ruby/models/enhance_transaction.rb +353 -0
  39. data/lib/mx-platform-ruby/models/enhance_transactions_request.rb +264 -0
  40. data/lib/mx-platform-ruby/models/enhance_transactions_request_body.rb +220 -0
  41. data/lib/mx-platform-ruby/models/enhance_transactions_response_body.rb +220 -0
  42. data/lib/mx-platform-ruby/models/holding.rb +371 -0
  43. data/lib/mx-platform-ruby/models/holding_response_body.rb +218 -0
  44. data/lib/mx-platform-ruby/models/holdings_response_body.rb +229 -0
  45. data/lib/mx-platform-ruby/models/inline_response200.rb +218 -0
  46. data/lib/mx-platform-ruby/models/institution.rb +299 -0
  47. data/lib/mx-platform-ruby/models/institution_response_body.rb +218 -0
  48. data/lib/mx-platform-ruby/models/institutions_response_body.rb +229 -0
  49. data/lib/mx-platform-ruby/models/member.rb +317 -0
  50. data/lib/mx-platform-ruby/models/member_create_request.rb +284 -0
  51. data/lib/mx-platform-ruby/models/member_create_request_body.rb +236 -0
  52. data/lib/mx-platform-ruby/models/member_response_body.rb +218 -0
  53. data/lib/mx-platform-ruby/models/member_resume_request.rb +220 -0
  54. data/lib/mx-platform-ruby/models/member_resume_request_body.rb +218 -0
  55. data/lib/mx-platform-ruby/models/member_status.rb +292 -0
  56. data/lib/mx-platform-ruby/models/member_status_response_body.rb +218 -0
  57. data/lib/mx-platform-ruby/models/member_update_request.rb +256 -0
  58. data/lib/mx-platform-ruby/models/member_update_request_body.rb +218 -0
  59. data/lib/mx-platform-ruby/models/members_response_body.rb +229 -0
  60. data/lib/mx-platform-ruby/models/merchant.rb +263 -0
  61. data/lib/mx-platform-ruby/models/merchant_response_body.rb +218 -0
  62. data/lib/mx-platform-ruby/models/merchants_response_body.rb +229 -0
  63. data/lib/mx-platform-ruby/models/o_auth_window.rb +227 -0
  64. data/lib/mx-platform-ruby/models/o_auth_window_response_body.rb +218 -0
  65. data/lib/mx-platform-ruby/models/pagination.rb +245 -0
  66. data/lib/mx-platform-ruby/models/statement.rb +281 -0
  67. data/lib/mx-platform-ruby/models/statement_response_body.rb +218 -0
  68. data/lib/mx-platform-ruby/models/statements_response_body.rb +229 -0
  69. data/lib/mx-platform-ruby/models/tag.rb +236 -0
  70. data/lib/mx-platform-ruby/models/tag_create_request.rb +223 -0
  71. data/lib/mx-platform-ruby/models/tag_create_request_body.rb +218 -0
  72. data/lib/mx-platform-ruby/models/tag_response_body.rb +218 -0
  73. data/lib/mx-platform-ruby/models/tag_update_request.rb +223 -0
  74. data/lib/mx-platform-ruby/models/tag_update_request_body.rb +218 -0
  75. data/lib/mx-platform-ruby/models/tagging.rb +254 -0
  76. data/lib/mx-platform-ruby/models/tagging_create_request.rb +237 -0
  77. data/lib/mx-platform-ruby/models/tagging_create_request_body.rb +218 -0
  78. data/lib/mx-platform-ruby/models/tagging_response_body.rb +218 -0
  79. data/lib/mx-platform-ruby/models/tagging_update_request.rb +223 -0
  80. data/lib/mx-platform-ruby/models/tagging_update_request_body.rb +218 -0
  81. data/lib/mx-platform-ruby/models/taggings_response_body.rb +229 -0
  82. data/lib/mx-platform-ruby/models/tags_response_body.rb +229 -0
  83. data/lib/mx-platform-ruby/models/transaction.rb +533 -0
  84. data/lib/mx-platform-ruby/models/transaction_response_body.rb +218 -0
  85. data/lib/mx-platform-ruby/models/transaction_rule.rb +272 -0
  86. data/lib/mx-platform-ruby/models/transaction_rule_create_request.rb +246 -0
  87. data/lib/mx-platform-ruby/models/transaction_rule_create_request_body.rb +218 -0
  88. data/lib/mx-platform-ruby/models/transaction_rule_response_body.rb +218 -0
  89. data/lib/mx-platform-ruby/models/transaction_rule_update_request.rb +236 -0
  90. data/lib/mx-platform-ruby/models/transaction_rule_update_request_body.rb +218 -0
  91. data/lib/mx-platform-ruby/models/transaction_rules_response_body.rb +229 -0
  92. data/lib/mx-platform-ruby/models/transaction_update_request.rb +223 -0
  93. data/lib/mx-platform-ruby/models/transaction_update_request_body.rb +218 -0
  94. data/lib/mx-platform-ruby/models/transactions_response_body.rb +229 -0
  95. data/lib/mx-platform-ruby/models/user.rb +254 -0
  96. data/lib/mx-platform-ruby/models/user_create_request.rb +245 -0
  97. data/lib/mx-platform-ruby/models/user_create_request_body.rb +218 -0
  98. data/lib/mx-platform-ruby/models/user_response_body.rb +218 -0
  99. data/lib/mx-platform-ruby/models/user_update_request.rb +245 -0
  100. data/lib/mx-platform-ruby/models/user_update_request_body.rb +218 -0
  101. data/lib/mx-platform-ruby/models/users_response_body.rb +229 -0
  102. data/lib/mx-platform-ruby/models/widget.rb +236 -0
  103. data/lib/mx-platform-ruby/models/widget_request.rb +331 -0
  104. data/lib/mx-platform-ruby/models/widget_request_body.rb +218 -0
  105. data/lib/mx-platform-ruby/models/widget_response_body.rb +218 -0
  106. data/lib/mx-platform-ruby/version.rb +13 -3
  107. data/mx-platform-ruby.gemspec +34 -27
  108. data/openapi/mx_platform_ruby.yml +11 -0
  109. data/spec/api/mx_platform_api_spec.rb +979 -0
  110. data/spec/api_client_spec.rb +188 -0
  111. data/spec/configuration_spec.rb +42 -0
  112. data/spec/models/account_number_spec.rb +76 -0
  113. data/spec/models/account_numbers_response_body_spec.rb +40 -0
  114. data/spec/models/account_owner_spec.rb +100 -0
  115. data/spec/models/account_owners_response_body_spec.rb +40 -0
  116. data/spec/models/account_response_body_spec.rb +34 -0
  117. data/spec/models/account_spec.rb +268 -0
  118. data/spec/models/account_update_request_body_spec.rb +34 -0
  119. data/spec/models/account_update_request_spec.rb +34 -0
  120. data/spec/models/accounts_response_body_spec.rb +40 -0
  121. data/spec/models/categories_response_body_spec.rb +40 -0
  122. data/spec/models/category_create_request_body_spec.rb +34 -0
  123. data/spec/models/category_create_request_spec.rb +46 -0
  124. data/spec/models/category_response_body_spec.rb +34 -0
  125. data/spec/models/category_spec.rb +76 -0
  126. data/spec/models/category_update_request_body_spec.rb +34 -0
  127. data/spec/models/category_update_request_spec.rb +40 -0
  128. data/spec/models/challenge_image_options_spec.rb +46 -0
  129. data/spec/models/challenge_options_spec.rb +40 -0
  130. data/spec/models/challenge_spec.rb +70 -0
  131. data/spec/models/challenges_response_body_spec.rb +40 -0
  132. data/spec/models/connect_widget_request_body_spec.rb +34 -0
  133. data/spec/models/connect_widget_request_spec.rb +94 -0
  134. data/spec/models/connect_widget_response_body_spec.rb +34 -0
  135. data/spec/models/connect_widget_spec.rb +40 -0
  136. data/spec/models/credential_request_spec.rb +40 -0
  137. data/spec/models/credential_spec.rb +58 -0
  138. data/spec/models/credentials_response_body_spec.rb +40 -0
  139. data/spec/models/enhance_transaction_spec.rb +124 -0
  140. data/spec/models/enhance_transactions_request_body_spec.rb +34 -0
  141. data/spec/models/enhance_transactions_request_spec.rb +58 -0
  142. data/spec/models/enhance_transactions_response_body_spec.rb +34 -0
  143. data/spec/models/holding_response_body_spec.rb +34 -0
  144. data/spec/models/holding_spec.rb +136 -0
  145. data/spec/models/holdings_response_body_spec.rb +40 -0
  146. data/spec/models/inline_response200_spec.rb +34 -0
  147. data/spec/models/institution_response_body_spec.rb +34 -0
  148. data/spec/models/institution_spec.rb +88 -0
  149. data/spec/models/institutions_response_body_spec.rb +40 -0
  150. data/spec/models/member_create_request_body_spec.rb +46 -0
  151. data/spec/models/member_create_request_spec.rb +70 -0
  152. data/spec/models/member_response_body_spec.rb +34 -0
  153. data/spec/models/member_resume_request_body_spec.rb +34 -0
  154. data/spec/models/member_resume_request_spec.rb +34 -0
  155. data/spec/models/member_spec.rb +100 -0
  156. data/spec/models/member_status_response_body_spec.rb +34 -0
  157. data/spec/models/member_status_spec.rb +82 -0
  158. data/spec/models/member_update_request_body_spec.rb +34 -0
  159. data/spec/models/member_update_request_spec.rb +58 -0
  160. data/spec/models/members_response_body_spec.rb +40 -0
  161. data/spec/models/merchant_response_body_spec.rb +34 -0
  162. data/spec/models/merchant_spec.rb +64 -0
  163. data/spec/models/merchants_response_body_spec.rb +40 -0
  164. data/spec/models/o_auth_window_response_body_spec.rb +34 -0
  165. data/spec/models/o_auth_window_spec.rb +40 -0
  166. data/spec/models/pagination_spec.rb +52 -0
  167. data/spec/models/statement_response_body_spec.rb +34 -0
  168. data/spec/models/statement_spec.rb +76 -0
  169. data/spec/models/statements_response_body_spec.rb +40 -0
  170. data/spec/models/tag_create_request_body_spec.rb +34 -0
  171. data/spec/models/tag_create_request_spec.rb +34 -0
  172. data/spec/models/tag_response_body_spec.rb +34 -0
  173. data/spec/models/tag_spec.rb +46 -0
  174. data/spec/models/tag_update_request_body_spec.rb +34 -0
  175. data/spec/models/tag_update_request_spec.rb +34 -0
  176. data/spec/models/tagging_create_request_body_spec.rb +34 -0
  177. data/spec/models/tagging_create_request_spec.rb +40 -0
  178. data/spec/models/tagging_response_body_spec.rb +34 -0
  179. data/spec/models/tagging_spec.rb +58 -0
  180. data/spec/models/tagging_update_request_body_spec.rb +34 -0
  181. data/spec/models/tagging_update_request_spec.rb +34 -0
  182. data/spec/models/taggings_response_body_spec.rb +40 -0
  183. data/spec/models/tags_response_body_spec.rb +40 -0
  184. data/spec/models/transaction_response_body_spec.rb +34 -0
  185. data/spec/models/transaction_rule_create_request_body_spec.rb +34 -0
  186. data/spec/models/transaction_rule_create_request_spec.rb +46 -0
  187. data/spec/models/transaction_rule_response_body_spec.rb +34 -0
  188. data/spec/models/transaction_rule_spec.rb +70 -0
  189. data/spec/models/transaction_rule_update_request_body_spec.rb +34 -0
  190. data/spec/models/transaction_rule_update_request_spec.rb +46 -0
  191. data/spec/models/transaction_rules_response_body_spec.rb +40 -0
  192. data/spec/models/transaction_spec.rb +244 -0
  193. data/spec/models/transaction_update_request_body_spec.rb +34 -0
  194. data/spec/models/transaction_update_request_spec.rb +34 -0
  195. data/spec/models/transactions_response_body_spec.rb +40 -0
  196. data/spec/models/user_create_request_body_spec.rb +34 -0
  197. data/spec/models/user_create_request_spec.rb +52 -0
  198. data/spec/models/user_response_body_spec.rb +34 -0
  199. data/spec/models/user_spec.rb +58 -0
  200. data/spec/models/user_update_request_body_spec.rb +34 -0
  201. data/spec/models/user_update_request_spec.rb +52 -0
  202. data/spec/models/users_response_body_spec.rb +40 -0
  203. data/spec/models/widget_request_body_spec.rb +34 -0
  204. data/spec/models/widget_request_spec.rb +106 -0
  205. data/spec/models/widget_response_body_spec.rb +34 -0
  206. data/spec/models/widget_spec.rb +46 -0
  207. data/spec/spec_helper.rb +100 -13
  208. metadata +317 -144
  209. data/.github/workflows/test.yml +0 -20
  210. data/.gitignore +0 -13
  211. data/.rubocop.yml +0 -44
  212. data/lib/mx-platform-ruby/account.rb +0 -107
  213. data/lib/mx-platform-ruby/account_number.rb +0 -57
  214. data/lib/mx-platform-ruby/account_owner.rb +0 -42
  215. data/lib/mx-platform-ruby/category.rb +0 -127
  216. data/lib/mx-platform-ruby/challenge.rb +0 -37
  217. data/lib/mx-platform-ruby/client.rb +0 -59
  218. data/lib/mx-platform-ruby/connect_widget.rb +0 -43
  219. data/lib/mx-platform-ruby/credential.rb +0 -54
  220. data/lib/mx-platform-ruby/enhanced_transaction.rb +0 -44
  221. data/lib/mx-platform-ruby/error.rb +0 -6
  222. data/lib/mx-platform-ruby/holding.rb +0 -87
  223. data/lib/mx-platform-ruby/institution.rb +0 -78
  224. data/lib/mx-platform-ruby/member.rb +0 -242
  225. data/lib/mx-platform-ruby/member_status.rb +0 -35
  226. data/lib/mx-platform-ruby/merchant.rb +0 -52
  227. data/lib/mx-platform-ruby/oauth_window.rb +0 -32
  228. data/lib/mx-platform-ruby/pageable.rb +0 -29
  229. data/lib/mx-platform-ruby/statement.rb +0 -70
  230. data/lib/mx-platform-ruby/tag.rb +0 -104
  231. data/lib/mx-platform-ruby/tagging.rb +0 -107
  232. data/lib/mx-platform-ruby/transaction.rb +0 -162
  233. data/lib/mx-platform-ruby/transaction_rule.rb +0 -112
  234. data/lib/mx-platform-ruby/user.rb +0 -112
  235. data/lib/mx-platform-ruby/widget.rb +0 -49
  236. data/spec/lib/mx-platform-ruby/account_number_spec.rb +0 -100
  237. data/spec/lib/mx-platform-ruby/account_owner_spec.rb +0 -71
  238. data/spec/lib/mx-platform-ruby/account_spec.rb +0 -267
  239. data/spec/lib/mx-platform-ruby/category_spec.rb +0 -244
  240. data/spec/lib/mx-platform-ruby/challenge_spec.rb +0 -72
  241. data/spec/lib/mx-platform-ruby/client_spec.rb +0 -101
  242. data/spec/lib/mx-platform-ruby/connect_widget_spec.rb +0 -66
  243. data/spec/lib/mx-platform-ruby/credential_spec.rb +0 -90
  244. data/spec/lib/mx-platform-ruby/enhanced_transaction_spec.rb +0 -89
  245. data/spec/lib/mx-platform-ruby/holding_spec.rb +0 -178
  246. data/spec/lib/mx-platform-ruby/institution_spec.rb +0 -141
  247. data/spec/lib/mx-platform-ruby/member_spec.rb +0 -557
  248. data/spec/lib/mx-platform-ruby/member_status_spec.rb +0 -76
  249. data/spec/lib/mx-platform-ruby/merchant_spec.rb +0 -89
  250. data/spec/lib/mx-platform-ruby/oauth_window_spec.rb +0 -47
  251. data/spec/lib/mx-platform-ruby/pageable_spec.rb +0 -75
  252. data/spec/lib/mx-platform-ruby/statement_spec.rb +0 -130
  253. data/spec/lib/mx-platform-ruby/tag_spec.rb +0 -179
  254. data/spec/lib/mx-platform-ruby/tagging_spec.rb +0 -191
  255. data/spec/lib/mx-platform-ruby/transaction_rule_spec.rb +0 -207
  256. data/spec/lib/mx-platform-ruby/transaction_spec.rb +0 -449
  257. data/spec/lib/mx-platform-ruby/user_spec.rb +0 -196
  258. data/spec/lib/mx-platform-ruby/widget_spec.rb +0 -76
  259. data/spec/lib/mx-platform-ruby_spec.rb +0 -15
  260. data/spec/sample.pdf +0 -0
@@ -1,141 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'spec_helper'
4
-
5
- RSpec.describe ::MXPlatformRuby::Institution do
6
- let(:institution_attributes) do
7
- {
8
- code: 'chase',
9
- medium_logo_url: 'https://content.moneydesktop.com/storage/MD_Assets/Ipad%20Logos/100x100/default_100x100.png',
10
- name: 'Chase Bank',
11
- small_logo_url: 'https://content.moneydesktop.com/storage/MD_Assets/Ipad%20Logos/50x50/default_50x50.png',
12
- supports_account_identification: true,
13
- supports_account_statement: true,
14
- supports_account_verification: true,
15
- supports_oauth: true,
16
- supports_transaction_history: true,
17
- url: 'https://www.chase.com'
18
- }
19
- end
20
- let(:list_favorites_options) do
21
- {
22
- page: 1,
23
- records_per_page: 10
24
- }
25
- end
26
- let(:list_institutions_options) do
27
- {
28
- name: 'chase',
29
- supports_account_identification: true,
30
- supports_account_statement: true,
31
- supports_account_verification: true,
32
- supports_transaction_history: true
33
- }
34
- end
35
- let(:read_institution_options) do
36
- {
37
- institution_code: 'chase'
38
- }
39
- end
40
- let(:pagination_attributes) do
41
- {
42
- 'current_page' => 1,
43
- 'per_page' => 25,
44
- 'total_pages' => 1,
45
- 'total_entries' => 1
46
- }
47
- end
48
-
49
- context 'list_favorites endpoints' do
50
- let(:list_favorites_response) do
51
- {
52
- 'institutions' => [institution_attributes],
53
- 'pagination' => pagination_attributes
54
- }
55
- end
56
-
57
- before { allow(::MXPlatformRuby.client).to receive(:make_request).and_return(list_favorites_response) }
58
-
59
- describe 'list_favorites' do
60
- it 'returns a list of institutions' do
61
- response = described_class.list_favorites
62
-
63
- expect(response).to be_kind_of(::MXPlatformRuby::Page)
64
- expect(response.first).to be_kind_of(::MXPlatformRuby::Institution)
65
- expect(response.first.code).to eq(institution_attributes[:code])
66
- expect(response.first.medium_logo_url).to eq(institution_attributes[:medium_logo_url])
67
- expect(response.first.name).to eq(institution_attributes[:name])
68
- expect(response.first.small_logo_url).to eq(institution_attributes[:small_logo_url])
69
- expect(response.first.supports_account_identification).to eq(institution_attributes[:supports_account_identification])
70
- expect(response.first.supports_account_statement).to eq(institution_attributes[:supports_account_statement])
71
- expect(response.first.supports_account_verification).to eq(institution_attributes[:supports_account_verification])
72
- expect(response.first.supports_oauth).to eq(institution_attributes[:supports_oauth])
73
- expect(response.first.supports_transaction_history).to eq(institution_attributes[:supports_transaction_history])
74
- expect(response.first.url).to eq(institution_attributes[:url])
75
- expect(response.length).to eq(1)
76
- end
77
- end
78
- end
79
-
80
- context 'list_institutions endpoints' do
81
- let(:list_institutions_response) do
82
- {
83
- 'institutions' => [institution_attributes],
84
- 'pagination' => pagination_attributes
85
- }
86
- end
87
-
88
- before { allow(::MXPlatformRuby.client).to receive(:make_request).and_return(list_institutions_response) }
89
-
90
- describe 'list_institutions' do
91
- it 'returns a list of institutions' do
92
- response = described_class.list_institutions
93
-
94
- expect(response).to be_kind_of(::MXPlatformRuby::Page)
95
- expect(response.first).to be_kind_of(::MXPlatformRuby::Institution)
96
- expect(response.first.code).to eq(institution_attributes[:code])
97
- expect(response.first.medium_logo_url).to eq(institution_attributes[:medium_logo_url])
98
- expect(response.first.name).to eq(institution_attributes[:name])
99
- expect(response.first.small_logo_url).to eq(institution_attributes[:small_logo_url])
100
- expect(response.first.supports_account_identification).to eq(institution_attributes[:supports_account_identification])
101
- expect(response.first.supports_account_statement).to eq(institution_attributes[:supports_account_statement])
102
- expect(response.first.supports_account_verification).to eq(institution_attributes[:supports_account_verification])
103
- expect(response.first.supports_oauth).to eq(institution_attributes[:supports_oauth])
104
- expect(response.first.supports_transaction_history).to eq(institution_attributes[:supports_transaction_history])
105
- expect(response.first.url).to eq(institution_attributes[:url])
106
- expect(response.length).to eq(1)
107
- end
108
- end
109
- end
110
-
111
- describe 'read_institution' do
112
- let(:read_institution_response) { { 'institution' => institution_attributes } }
113
- before { allow(::MXPlatformRuby.client).to receive(:make_request).and_return(read_institution_response) }
114
-
115
- it 'returns institution' do
116
- response = described_class.read_institution
117
-
118
- expect(response).to be_kind_of(::MXPlatformRuby::Institution)
119
- expect(response.code).to eq(institution_attributes[:code])
120
- expect(response.medium_logo_url).to eq(institution_attributes[:medium_logo_url])
121
- expect(response.name).to eq(institution_attributes[:name])
122
- expect(response.small_logo_url).to eq(institution_attributes[:small_logo_url])
123
- expect(response.supports_account_identification).to eq(institution_attributes[:supports_account_identification])
124
- expect(response.supports_account_statement).to eq(institution_attributes[:supports_account_statement])
125
- expect(response.supports_account_verification).to eq(institution_attributes[:supports_account_verification])
126
- expect(response.supports_oauth).to eq(institution_attributes[:supports_oauth])
127
- expect(response.supports_transaction_history).to eq(institution_attributes[:supports_transaction_history])
128
- expect(response.url).to eq(institution_attributes[:url])
129
- end
130
-
131
- it 'makes a client request with the expected params' do
132
- expect(::MXPlatformRuby.client).to receive(:make_request).with(
133
- {
134
- endpoint: '/institutions/chase',
135
- http_method: :get
136
- }
137
- )
138
- described_class.read_institution(read_institution_options)
139
- end
140
- end
141
- end
@@ -1,557 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'spec_helper'
4
-
5
- RSpec.describe ::MXPlatformRuby::Member do
6
- let(:member_attributes) do
7
- {
8
- aggregated_at: '2016-10-13T18:07:57.000Z',
9
- connection_status: 'CONNECTED',
10
- guid: 'MBR-7c6f361b-e582-15b6-60c0-358f12466b4b',
11
- id: 'unique_id',
12
- institution_code: 'chase',
13
- is_being_aggregated: false,
14
- is_oauth: false,
15
- metadata: '\"credentials_last_refreshed_at\": \"2015-10-15\"',
16
- name: 'Chase Bank',
17
- oauth_window_uri: 'int-widgets.moneydesktop.com/oauth/predirect_to/MBR-df96fd60-7122-4464-b3c2-ff11d8c74f6f/p8v7rxpxg3pdAsfgwxcrwxwhz3Zbygxfr6wAb931qv91hpb57k6bkr6t6m9djrfrfd467p8xkgqp6w7k1r9g8k8bfxqbfw2lq5tdwjq2sngAx76fm0jrw0dpmbtlkxchgjsw3r7r0hhq6A8sshqptfxql2rt123shfpkyhhpfvy67yvprbkb7lmlyrpwsd9yj0s22pmsyjhcw7d2q44d9fsxn5kfsmr2zqc79c2AxAx5gkjgbczf22A1sjx70t2pvnggzyh55s7bh62dd5wq7f1r4x90mcxn1tfhhrq5b09mjkt5hg66cjn700pcf6fgA42lbsp7v1pdch85mswycrp21c6j2sxffm14Asg3?skip_aggregation=false&referral_source=APP&ui_message_webview_url_scheme=myapp',
18
- successfully_aggregated_at: '2016-10-13T17:57:38.000Z',
19
- user_guid: 'USR-fa7537f3-48aa-a683-a02a-b18940482f54'
20
- }
21
- end
22
- let(:aggregate_member_options) do
23
- {
24
- member_guid: 'MBR-7c6f361b-e582-15b6-60c0-358f12466b4b',
25
- user_guid: 'USR-fa7537f3-48aa-a683-a02a-b18940482f54'
26
- }
27
- end
28
- let(:check_balances_options) do
29
- {
30
- member_guid: 'MBR-7c6f361b-e582-15b6-60c0-358f12466b4b',
31
- user_guid: 'USR-fa7537f3-48aa-a683-a02a-b18940482f54'
32
- }
33
- end
34
- let(:create_member_options) do
35
- {
36
- background_aggregation_is_disabled: false,
37
- credentials: [
38
- {
39
- guid: 'CRD-27d0edb8-1d50-5b90-bcbc-be270ca42b9f',
40
- value: 'password'
41
- }
42
- ],
43
- id: 'unique_id',
44
- institution_code: 'chase',
45
- is_oauth: false,
46
- metadata: '\"credentials_last_refreshed_at\": \"2015-10-15\"',
47
- referral_source: 'APP',
48
- skip_aggregation: false,
49
- ui_message_webview_url_scheme: 'mx',
50
- user_guid: 'USR-fa7537f3-48aa-a683-a02a-b18940482f54'
51
- }
52
- end
53
- let(:delete_member_options) do
54
- {
55
- member_guid: 'MBR-7c6f361b-e582-15b6-60c0-358f12466b4b',
56
- user_guid: 'USR-fa7537f3-48aa-a683-a02a-b18940482f54'
57
- }
58
- end
59
- let(:extend_history_options) do
60
- {
61
- member_guid: 'MBR-7c6f361b-e582-15b6-60c0-358f12466b4b',
62
- user_guid: 'USR-fa7537f3-48aa-a683-a02a-b18940482f54'
63
- }
64
- end
65
- let(:fetch_statements_by_member_options) do
66
- {
67
- member_guid: 'MBR-7c6f361b-e582-15b6-60c0-358f12466b4b',
68
- user_guid: 'USR-fa7537f3-48aa-a683-a02a-b18940482f54'
69
- }
70
- end
71
- let(:identify_member_options) do
72
- {
73
- member_guid: 'MBR-7c6f361b-e582-15b6-60c0-358f12466b4b',
74
- user_guid: 'USR-fa7537f3-48aa-a683-a02a-b18940482f54'
75
- }
76
- end
77
- let(:list_members_options) do
78
- {
79
- page: 1,
80
- records_per_page: 10,
81
- user_guid: 'USR-fa7537f3-48aa-a683-a02a-b18940482f54'
82
- }
83
- end
84
- let(:read_member_options) do
85
- {
86
- member_guid: 'MBR-7c6f361b-e582-15b6-60c0-358f12466b4b',
87
- user_guid: 'USR-fa7537f3-48aa-a683-a02a-b18940482f54'
88
- }
89
- end
90
- let(:resume_aggregation_options) do
91
- {
92
- challenges: [
93
- {
94
- guid: 'CRD-2378634-33ub5bhk54kjb',
95
- value: 'user-entered-value'
96
- }
97
- ],
98
- member_guid: 'MBR-7c6f361b-e582-15b6-60c0-358f12466b4b',
99
- user_guid: 'USR-fa7537f3-48aa-a683-a02a-b18940482f54'
100
- }
101
- end
102
- let(:update_member_options) do
103
- {
104
- background_aggregation_is_disabled: false,
105
- credentials: [
106
- {
107
- guid: 'CRD-27d0edb8-1d50-5b90-bcbc-be270ca42b9f',
108
- value: 'password'
109
- }
110
- ],
111
- id: 'unique_id',
112
- member_guid: 'MBR-7c6f361b-e582-15b6-60c0-358f12466b4b',
113
- metadata: '\"credentials_last_refreshed_at\": \"2015-10-15\"',
114
- skip_aggregation: false,
115
- user_guid: 'USR-fa7537f3-48aa-a683-a02a-b18940482f54'
116
- }
117
- end
118
- let(:verify_member_options) do
119
- {
120
- member_guid: 'MBR-7c6f361b-e582-15b6-60c0-358f12466b4b',
121
- user_guid: 'USR-fa7537f3-48aa-a683-a02a-b18940482f54'
122
- }
123
- end
124
- let(:pagination_attributes) do
125
- {
126
- 'current_page' => 1,
127
- 'per_page' => 25,
128
- 'total_pages' => 1,
129
- 'total_entries' => 1
130
- }
131
- end
132
-
133
- describe 'aggregate_member' do
134
- let(:aggregate_member_response) { { 'member' => member_attributes } }
135
- before { allow(::MXPlatformRuby.client).to receive(:make_request).and_return(aggregate_member_response) }
136
-
137
- it 'returns member' do
138
- response = described_class.aggregate_member
139
-
140
- expect(response).to be_kind_of(::MXPlatformRuby::Member)
141
- expect(response.aggregated_at).to eq(member_attributes[:aggregated_at])
142
- expect(response.connection_status).to eq(member_attributes[:connection_status])
143
- expect(response.guid).to eq(member_attributes[:guid])
144
- expect(response.id).to eq(member_attributes[:id])
145
- expect(response.institution_code).to eq(member_attributes[:institution_code])
146
- expect(response.is_being_aggregated).to eq(member_attributes[:is_being_aggregated])
147
- expect(response.is_oauth).to eq(member_attributes[:is_oauth])
148
- expect(response.metadata).to eq(member_attributes[:metadata])
149
- expect(response.name).to eq(member_attributes[:name])
150
- expect(response.oauth_window_uri).to eq(member_attributes[:oauth_window_uri])
151
- expect(response.successfully_aggregated_at).to eq(member_attributes[:successfully_aggregated_at])
152
- expect(response.user_guid).to eq(member_attributes[:user_guid])
153
- end
154
-
155
- it 'makes a client request with the expected params' do
156
- expect(::MXPlatformRuby.client).to receive(:make_request).with(
157
- {
158
- endpoint: '/users/USR-fa7537f3-48aa-a683-a02a-b18940482f54/members/MBR-7c6f361b-e582-15b6-60c0-358f12466b4b/aggregate',
159
- http_method: :post
160
- }
161
- )
162
- described_class.aggregate_member(aggregate_member_options)
163
- end
164
- end
165
-
166
- describe 'check_balances' do
167
- let(:check_balances_response) { { 'member' => member_attributes } }
168
- before { allow(::MXPlatformRuby.client).to receive(:make_request).and_return(check_balances_response) }
169
-
170
- it 'returns member' do
171
- response = described_class.check_balances
172
-
173
- expect(response).to be_kind_of(::MXPlatformRuby::Member)
174
- expect(response.aggregated_at).to eq(member_attributes[:aggregated_at])
175
- expect(response.connection_status).to eq(member_attributes[:connection_status])
176
- expect(response.guid).to eq(member_attributes[:guid])
177
- expect(response.id).to eq(member_attributes[:id])
178
- expect(response.institution_code).to eq(member_attributes[:institution_code])
179
- expect(response.is_being_aggregated).to eq(member_attributes[:is_being_aggregated])
180
- expect(response.is_oauth).to eq(member_attributes[:is_oauth])
181
- expect(response.metadata).to eq(member_attributes[:metadata])
182
- expect(response.name).to eq(member_attributes[:name])
183
- expect(response.oauth_window_uri).to eq(member_attributes[:oauth_window_uri])
184
- expect(response.successfully_aggregated_at).to eq(member_attributes[:successfully_aggregated_at])
185
- expect(response.user_guid).to eq(member_attributes[:user_guid])
186
- end
187
-
188
- it 'makes a client request with the expected params' do
189
- expect(::MXPlatformRuby.client).to receive(:make_request).with(
190
- {
191
- endpoint: '/users/USR-fa7537f3-48aa-a683-a02a-b18940482f54/members/MBR-7c6f361b-e582-15b6-60c0-358f12466b4b/check_balance',
192
- http_method: :post
193
- }
194
- )
195
- described_class.check_balances(check_balances_options)
196
- end
197
- end
198
-
199
- describe 'create_member' do
200
- let(:create_member_response) { { 'member' => member_attributes } }
201
- before { allow(::MXPlatformRuby.client).to receive(:make_request).and_return(create_member_response) }
202
-
203
- it 'returns member' do
204
- response = described_class.create_member
205
-
206
- expect(response).to be_kind_of(::MXPlatformRuby::Member)
207
- expect(response.aggregated_at).to eq(member_attributes[:aggregated_at])
208
- expect(response.connection_status).to eq(member_attributes[:connection_status])
209
- expect(response.guid).to eq(member_attributes[:guid])
210
- expect(response.id).to eq(member_attributes[:id])
211
- expect(response.institution_code).to eq(member_attributes[:institution_code])
212
- expect(response.is_being_aggregated).to eq(member_attributes[:is_being_aggregated])
213
- expect(response.is_oauth).to eq(member_attributes[:is_oauth])
214
- expect(response.metadata).to eq(member_attributes[:metadata])
215
- expect(response.name).to eq(member_attributes[:name])
216
- expect(response.oauth_window_uri).to eq(member_attributes[:oauth_window_uri])
217
- expect(response.successfully_aggregated_at).to eq(member_attributes[:successfully_aggregated_at])
218
- expect(response.user_guid).to eq(member_attributes[:user_guid])
219
- end
220
-
221
- it 'makes a client request with the expected params' do
222
- expect(::MXPlatformRuby.client).to receive(:make_request).with(
223
- {
224
- endpoint: '/users/USR-fa7537f3-48aa-a683-a02a-b18940482f54/members',
225
- http_method: :post,
226
- request_body: {
227
- member: {
228
- background_aggregation_is_disabled: false,
229
- credentials: [
230
- {
231
- guid: 'CRD-27d0edb8-1d50-5b90-bcbc-be270ca42b9f',
232
- value: 'password'
233
- }
234
- ],
235
- id: 'unique_id',
236
- institution_code: 'chase',
237
- is_oauth: false,
238
- metadata: '\"credentials_last_refreshed_at\": \"2015-10-15\"',
239
- skip_aggregation: false
240
- },
241
- referral_source: 'APP',
242
- ui_message_webview_url_scheme: 'mx'
243
- }
244
- }
245
- )
246
- described_class.create_member(create_member_options)
247
- end
248
- end
249
-
250
- describe 'delete_member' do
251
- before { allow(::MXPlatformRuby.client).to receive(:make_request).and_return(nil) }
252
-
253
- it 'returns nil' do
254
- response = described_class.delete_member
255
-
256
- expect(response).to be(nil)
257
- end
258
-
259
- it 'makes a client request with the expected params' do
260
- expect(::MXPlatformRuby.client).to receive(:make_request).with(
261
- {
262
- endpoint: '/users/USR-fa7537f3-48aa-a683-a02a-b18940482f54/members/MBR-7c6f361b-e582-15b6-60c0-358f12466b4b',
263
- http_method: :delete
264
- }
265
- )
266
- described_class.delete_member(delete_member_options)
267
- end
268
- end
269
-
270
- describe 'extend_history' do
271
- let(:extend_history_response) { { 'member' => member_attributes } }
272
- before { allow(::MXPlatformRuby.client).to receive(:make_request).and_return(extend_history_response) }
273
-
274
- it 'returns member' do
275
- response = described_class.extend_history
276
-
277
- expect(response).to be_kind_of(::MXPlatformRuby::Member)
278
- expect(response.aggregated_at).to eq(member_attributes[:aggregated_at])
279
- expect(response.connection_status).to eq(member_attributes[:connection_status])
280
- expect(response.guid).to eq(member_attributes[:guid])
281
- expect(response.id).to eq(member_attributes[:id])
282
- expect(response.institution_code).to eq(member_attributes[:institution_code])
283
- expect(response.is_being_aggregated).to eq(member_attributes[:is_being_aggregated])
284
- expect(response.is_oauth).to eq(member_attributes[:is_oauth])
285
- expect(response.metadata).to eq(member_attributes[:metadata])
286
- expect(response.name).to eq(member_attributes[:name])
287
- expect(response.oauth_window_uri).to eq(member_attributes[:oauth_window_uri])
288
- expect(response.successfully_aggregated_at).to eq(member_attributes[:successfully_aggregated_at])
289
- expect(response.user_guid).to eq(member_attributes[:user_guid])
290
- end
291
-
292
- it 'makes a client request with the expected params' do
293
- expect(::MXPlatformRuby.client).to receive(:make_request).with(
294
- {
295
- endpoint: '/users/USR-fa7537f3-48aa-a683-a02a-b18940482f54/members/MBR-7c6f361b-e582-15b6-60c0-358f12466b4b/extend_history',
296
- http_method: :post
297
- }
298
- )
299
- described_class.extend_history(extend_history_options)
300
- end
301
- end
302
-
303
- describe 'fetch_statements_by_member' do
304
- let(:fetch_statements_by_member_response) { { 'member' => member_attributes } }
305
- before { allow(::MXPlatformRuby.client).to receive(:make_request).and_return(fetch_statements_by_member_response) }
306
-
307
- it 'returns member' do
308
- response = described_class.fetch_statements_by_member
309
-
310
- expect(response).to be_kind_of(::MXPlatformRuby::Member)
311
- expect(response.aggregated_at).to eq(member_attributes[:aggregated_at])
312
- expect(response.connection_status).to eq(member_attributes[:connection_status])
313
- expect(response.guid).to eq(member_attributes[:guid])
314
- expect(response.id).to eq(member_attributes[:id])
315
- expect(response.institution_code).to eq(member_attributes[:institution_code])
316
- expect(response.is_being_aggregated).to eq(member_attributes[:is_being_aggregated])
317
- expect(response.is_oauth).to eq(member_attributes[:is_oauth])
318
- expect(response.metadata).to eq(member_attributes[:metadata])
319
- expect(response.name).to eq(member_attributes[:name])
320
- expect(response.oauth_window_uri).to eq(member_attributes[:oauth_window_uri])
321
- expect(response.successfully_aggregated_at).to eq(member_attributes[:successfully_aggregated_at])
322
- expect(response.user_guid).to eq(member_attributes[:user_guid])
323
- end
324
-
325
- it 'makes a client request with the expected params' do
326
- expect(::MXPlatformRuby.client).to receive(:make_request).with(
327
- {
328
- endpoint: '/users/USR-fa7537f3-48aa-a683-a02a-b18940482f54/members/MBR-7c6f361b-e582-15b6-60c0-358f12466b4b/fetch_statements',
329
- http_method: :post
330
- }
331
- )
332
- described_class.fetch_statements_by_member(fetch_statements_by_member_options)
333
- end
334
- end
335
-
336
- describe 'identify_member' do
337
- let(:identify_member_response) { { 'member' => member_attributes } }
338
- before { allow(::MXPlatformRuby.client).to receive(:make_request).and_return(identify_member_response) }
339
-
340
- it 'returns member' do
341
- response = described_class.identify_member
342
-
343
- expect(response).to be_kind_of(::MXPlatformRuby::Member)
344
- expect(response.aggregated_at).to eq(member_attributes[:aggregated_at])
345
- expect(response.connection_status).to eq(member_attributes[:connection_status])
346
- expect(response.guid).to eq(member_attributes[:guid])
347
- expect(response.id).to eq(member_attributes[:id])
348
- expect(response.institution_code).to eq(member_attributes[:institution_code])
349
- expect(response.is_being_aggregated).to eq(member_attributes[:is_being_aggregated])
350
- expect(response.is_oauth).to eq(member_attributes[:is_oauth])
351
- expect(response.metadata).to eq(member_attributes[:metadata])
352
- expect(response.name).to eq(member_attributes[:name])
353
- expect(response.oauth_window_uri).to eq(member_attributes[:oauth_window_uri])
354
- expect(response.successfully_aggregated_at).to eq(member_attributes[:successfully_aggregated_at])
355
- expect(response.user_guid).to eq(member_attributes[:user_guid])
356
- end
357
-
358
- it 'makes a client request with the expected params' do
359
- expect(::MXPlatformRuby.client).to receive(:make_request).with(
360
- {
361
- endpoint: '/users/USR-fa7537f3-48aa-a683-a02a-b18940482f54/members/MBR-7c6f361b-e582-15b6-60c0-358f12466b4b/identify',
362
- http_method: :post
363
- }
364
- )
365
- described_class.identify_member(identify_member_options)
366
- end
367
- end
368
-
369
- context 'list_members endpoints' do
370
- let(:list_members_response) do
371
- {
372
- 'members' => [member_attributes],
373
- 'pagination' => pagination_attributes
374
- }
375
- end
376
-
377
- before { allow(::MXPlatformRuby.client).to receive(:make_request).and_return(list_members_response) }
378
-
379
- describe 'list_members' do
380
- it 'returns a list of members' do
381
- response = described_class.list_members
382
-
383
- expect(response).to be_kind_of(::MXPlatformRuby::Page)
384
- expect(response.first).to be_kind_of(::MXPlatformRuby::Member)
385
- expect(response.first.aggregated_at).to eq(member_attributes[:aggregated_at])
386
- expect(response.first.connection_status).to eq(member_attributes[:connection_status])
387
- expect(response.first.guid).to eq(member_attributes[:guid])
388
- expect(response.first.id).to eq(member_attributes[:id])
389
- expect(response.first.institution_code).to eq(member_attributes[:institution_code])
390
- expect(response.first.is_being_aggregated).to eq(member_attributes[:is_being_aggregated])
391
- expect(response.first.is_oauth).to eq(member_attributes[:is_oauth])
392
- expect(response.first.metadata).to eq(member_attributes[:metadata])
393
- expect(response.first.name).to eq(member_attributes[:name])
394
- expect(response.first.oauth_window_uri).to eq(member_attributes[:oauth_window_uri])
395
- expect(response.first.successfully_aggregated_at).to eq(member_attributes[:successfully_aggregated_at])
396
- expect(response.first.user_guid).to eq(member_attributes[:user_guid])
397
- expect(response.length).to eq(1)
398
- end
399
- end
400
- end
401
-
402
- describe 'read_member' do
403
- let(:read_member_response) { { 'member' => member_attributes } }
404
- before { allow(::MXPlatformRuby.client).to receive(:make_request).and_return(read_member_response) }
405
-
406
- it 'returns member' do
407
- response = described_class.read_member
408
-
409
- expect(response).to be_kind_of(::MXPlatformRuby::Member)
410
- expect(response.aggregated_at).to eq(member_attributes[:aggregated_at])
411
- expect(response.connection_status).to eq(member_attributes[:connection_status])
412
- expect(response.guid).to eq(member_attributes[:guid])
413
- expect(response.id).to eq(member_attributes[:id])
414
- expect(response.institution_code).to eq(member_attributes[:institution_code])
415
- expect(response.is_being_aggregated).to eq(member_attributes[:is_being_aggregated])
416
- expect(response.is_oauth).to eq(member_attributes[:is_oauth])
417
- expect(response.metadata).to eq(member_attributes[:metadata])
418
- expect(response.name).to eq(member_attributes[:name])
419
- expect(response.oauth_window_uri).to eq(member_attributes[:oauth_window_uri])
420
- expect(response.successfully_aggregated_at).to eq(member_attributes[:successfully_aggregated_at])
421
- expect(response.user_guid).to eq(member_attributes[:user_guid])
422
- end
423
-
424
- it 'makes a client request with the expected params' do
425
- expect(::MXPlatformRuby.client).to receive(:make_request).with(
426
- {
427
- endpoint: '/users/USR-fa7537f3-48aa-a683-a02a-b18940482f54/members/MBR-7c6f361b-e582-15b6-60c0-358f12466b4b',
428
- http_method: :get
429
- }
430
- )
431
- described_class.read_member(read_member_options)
432
- end
433
- end
434
-
435
- describe 'resume_aggregation' do
436
- let(:resume_aggregation_response) { { 'member' => member_attributes } }
437
- before { allow(::MXPlatformRuby.client).to receive(:make_request).and_return(resume_aggregation_response) }
438
-
439
- it 'returns member' do
440
- response = described_class.resume_aggregation
441
-
442
- expect(response).to be_kind_of(::MXPlatformRuby::Member)
443
- expect(response.aggregated_at).to eq(member_attributes[:aggregated_at])
444
- expect(response.connection_status).to eq(member_attributes[:connection_status])
445
- expect(response.guid).to eq(member_attributes[:guid])
446
- expect(response.id).to eq(member_attributes[:id])
447
- expect(response.institution_code).to eq(member_attributes[:institution_code])
448
- expect(response.is_being_aggregated).to eq(member_attributes[:is_being_aggregated])
449
- expect(response.is_oauth).to eq(member_attributes[:is_oauth])
450
- expect(response.metadata).to eq(member_attributes[:metadata])
451
- expect(response.name).to eq(member_attributes[:name])
452
- expect(response.oauth_window_uri).to eq(member_attributes[:oauth_window_uri])
453
- expect(response.successfully_aggregated_at).to eq(member_attributes[:successfully_aggregated_at])
454
- expect(response.user_guid).to eq(member_attributes[:user_guid])
455
- end
456
-
457
- it 'makes a client request with the expected params' do
458
- expect(::MXPlatformRuby.client).to receive(:make_request).with(
459
- {
460
- endpoint: '/users/USR-fa7537f3-48aa-a683-a02a-b18940482f54/members/MBR-7c6f361b-e582-15b6-60c0-358f12466b4b/resume',
461
- http_method: :put,
462
- request_body: {
463
- member: {
464
- challenges: [
465
- {
466
- guid: 'CRD-2378634-33ub5bhk54kjb',
467
- value: 'user-entered-value'
468
- }
469
- ]
470
- }
471
- }
472
- }
473
- )
474
- described_class.resume_aggregation(resume_aggregation_options)
475
- end
476
- end
477
-
478
- describe 'update_member' do
479
- let(:update_member_response) { { 'member' => member_attributes } }
480
- before { allow(::MXPlatformRuby.client).to receive(:make_request).and_return(update_member_response) }
481
-
482
- it 'returns member' do
483
- response = described_class.update_member
484
-
485
- expect(response).to be_kind_of(::MXPlatformRuby::Member)
486
- expect(response.aggregated_at).to eq(member_attributes[:aggregated_at])
487
- expect(response.connection_status).to eq(member_attributes[:connection_status])
488
- expect(response.guid).to eq(member_attributes[:guid])
489
- expect(response.id).to eq(member_attributes[:id])
490
- expect(response.institution_code).to eq(member_attributes[:institution_code])
491
- expect(response.is_being_aggregated).to eq(member_attributes[:is_being_aggregated])
492
- expect(response.is_oauth).to eq(member_attributes[:is_oauth])
493
- expect(response.metadata).to eq(member_attributes[:metadata])
494
- expect(response.name).to eq(member_attributes[:name])
495
- expect(response.oauth_window_uri).to eq(member_attributes[:oauth_window_uri])
496
- expect(response.successfully_aggregated_at).to eq(member_attributes[:successfully_aggregated_at])
497
- expect(response.user_guid).to eq(member_attributes[:user_guid])
498
- end
499
-
500
- it 'makes a client request with the expected params' do
501
- expect(::MXPlatformRuby.client).to receive(:make_request).with(
502
- {
503
- endpoint: '/users/USR-fa7537f3-48aa-a683-a02a-b18940482f54/members/MBR-7c6f361b-e582-15b6-60c0-358f12466b4b',
504
- http_method: :put,
505
- request_body: {
506
- member: {
507
- background_aggregation_is_disabled: false,
508
- credentials: [
509
- {
510
- guid: 'CRD-27d0edb8-1d50-5b90-bcbc-be270ca42b9f',
511
- value: 'password'
512
- }
513
- ],
514
- id: 'unique_id',
515
- metadata: '\"credentials_last_refreshed_at\": \"2015-10-15\"',
516
- skip_aggregation: false
517
- }
518
- }
519
- }
520
- )
521
- described_class.update_member(update_member_options)
522
- end
523
- end
524
-
525
- describe 'verify_member' do
526
- let(:verify_member_response) { { 'member' => member_attributes } }
527
- before { allow(::MXPlatformRuby.client).to receive(:make_request).and_return(verify_member_response) }
528
-
529
- it 'returns member' do
530
- response = described_class.verify_member
531
-
532
- expect(response).to be_kind_of(::MXPlatformRuby::Member)
533
- expect(response.aggregated_at).to eq(member_attributes[:aggregated_at])
534
- expect(response.connection_status).to eq(member_attributes[:connection_status])
535
- expect(response.guid).to eq(member_attributes[:guid])
536
- expect(response.id).to eq(member_attributes[:id])
537
- expect(response.institution_code).to eq(member_attributes[:institution_code])
538
- expect(response.is_being_aggregated).to eq(member_attributes[:is_being_aggregated])
539
- expect(response.is_oauth).to eq(member_attributes[:is_oauth])
540
- expect(response.metadata).to eq(member_attributes[:metadata])
541
- expect(response.name).to eq(member_attributes[:name])
542
- expect(response.oauth_window_uri).to eq(member_attributes[:oauth_window_uri])
543
- expect(response.successfully_aggregated_at).to eq(member_attributes[:successfully_aggregated_at])
544
- expect(response.user_guid).to eq(member_attributes[:user_guid])
545
- end
546
-
547
- it 'makes a client request with the expected params' do
548
- expect(::MXPlatformRuby.client).to receive(:make_request).with(
549
- {
550
- endpoint: '/users/USR-fa7537f3-48aa-a683-a02a-b18940482f54/members/MBR-7c6f361b-e582-15b6-60c0-358f12466b4b/verify',
551
- http_method: :post
552
- }
553
- )
554
- described_class.verify_member(verify_member_options)
555
- end
556
- end
557
- end