File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
algora_web/controllers/webhooks Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 11defmodule Algora.PaymentsTest do
22 use Algora.DataCase
33
4+ import ExUnit.CaptureLog
5+
46 alias Algora.Payments
57 alias Algora.Payments.Account
68 alias Algora.Payments.Transaction
@@ -99,7 +101,8 @@ defmodule Algora.PaymentsTest do
99101
100102 Account |> Repo . one! ( ) |> change ( % { provider_id: "acct_invalid" } ) |> Repo . update! ( )
101103
102- assert { :error , _ } = Payments . execute_pending_transfers ( user . id )
104+ { result , _log } = with_log ( fn -> Payments . execute_pending_transfers ( user . id ) end )
105+ assert { :error , % Stripe.Error { code: :invalid_request_error } } = result
103106
104107 transfer_tx = Repo . one ( from t in Transaction , where: t . type == :transfer )
105108 assert transfer_tx . status == :failed
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ defmodule AlgoraWeb.Webhooks.GithubControllerTest do
55
66 import Algora.Factory
77 import Ecto.Query
8+ import ExUnit.CaptureLog
89 import Money.Sigil
910
1011 alias Algora.Bounties.Bounty
@@ -33,7 +34,8 @@ defmodule AlgoraWeb.Webhooks.GithubControllerTest do
3334 describe "create bounties" do
3435 test "handles bounty command with unauthorized user" , ctx do
3536 scenario = [ % { event_action: "issue_comment.created" , user_type: :unauthorized , body: "/bounty $100" } ]
36- assert { :error , :unauthorized } = process_scenario ( ctx , scenario )
37+ { result , _log } = with_log ( fn -> process_scenario ( ctx , scenario ) end )
38+ assert { :error , :unauthorized } = result
3739 assert Repo . aggregate ( Bounty , :count ) == 0
3840 end
3941
You can’t perform that action at this time.
0 commit comments