@@ -9,7 +9,6 @@ class PlaidAccountCallsTest < ActiveSupport::TestCase
9
9
10
10
test "plaid_accounts returns an array of PlaidAccount objects on success response" do
11
11
response = mock_faraday_response ( fake_plaid_accounts_call )
12
-
13
12
LunchMoney ::PlaidAccountCalls . any_instance . stubs ( :get ) . returns ( response )
14
13
15
14
api_call = LunchMoney ::PlaidAccountCalls . new . plaid_accounts
@@ -19,7 +18,6 @@ class PlaidAccountCallsTest < ActiveSupport::TestCase
19
18
20
19
test "plaid_accounts returns an array of Error objects on error response" do
21
20
response = mock_faraday_response ( fake_general_error )
22
-
23
21
LunchMoney ::PlaidAccountCalls . any_instance . stubs ( :get ) . returns ( response )
24
22
25
23
api_call = LunchMoney ::PlaidAccountCalls . new . plaid_accounts
@@ -28,18 +26,16 @@ class PlaidAccountCallsTest < ActiveSupport::TestCase
28
26
end
29
27
30
28
test "plaid_accounts_fetch returns a boolean response on success" do
31
- response = mock_faraday_response ( true )
32
-
33
- LunchMoney ::PlaidAccountCalls . any_instance . stubs ( :post ) . returns ( response )
29
+ VCR . use_cassette ( "plaid_accounts/plaid_accounts_fetch_success" ) do
30
+ ensure_correct_api_key
31
+ api_call = LunchMoney ::PlaidAccountCalls . new . plaid_accounts_fetch
34
32
35
- api_call = LunchMoney ::PlaidAccountCalls . new . plaid_accounts_fetch
36
-
37
- assert_kind_of ( TrueClass , api_call )
33
+ assert_kind_of ( FalseClass , api_call )
34
+ end
38
35
end
39
36
40
37
test "plaid_accounts_fetch returns an array of Error objects on error response" do
41
38
response = mock_faraday_response ( fake_general_error )
42
-
43
39
LunchMoney ::PlaidAccountCalls . any_instance . stubs ( :post ) . returns ( response )
44
40
45
41
api_call = LunchMoney ::PlaidAccountCalls . new . plaid_accounts_fetch
0 commit comments