mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 20:14:08 +00:00
Do not raise on Plaid item not found exceptions for item deletions (#1646)
This commit is contained in:
@@ -18,4 +18,16 @@ class PlaidItemTest < ActiveSupport::TestCase
|
||||
@plaid_item.destroy
|
||||
end
|
||||
end
|
||||
|
||||
test "if plaid item not found, silently continues with deletion" do
|
||||
@plaid_provider = mock
|
||||
|
||||
PlaidItem.stubs(:plaid_provider).returns(@plaid_provider)
|
||||
|
||||
@plaid_provider.expects(:remove_item).with(@plaid_item.access_token).raises(Plaid::ApiError.new("Item not found"))
|
||||
|
||||
assert_difference "PlaidItem.count", -1 do
|
||||
@plaid_item.destroy
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user