mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 03:54:08 +00:00
Fix: Fix unalble to reject automatched transfers (#2102)
Co-authored-by: Zach Gollwitzer <zach@maybe.co>
This commit is contained in:
@@ -41,4 +41,24 @@ class TransfersControllerTest < ActionDispatch::IntegrationTest
|
||||
assert_equal "Transfer updated", flash[:notice]
|
||||
assert_equal "Test notes", transfer.reload.notes
|
||||
end
|
||||
|
||||
test "handles rejection without FrozenError" do
|
||||
transfer = transfers(:one)
|
||||
|
||||
assert_difference "Transfer.count", -1 do
|
||||
patch transfer_url(transfer), params: {
|
||||
transfer: {
|
||||
status: "rejected"
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
assert_redirected_to transactions_url
|
||||
assert_equal "Transfer updated", flash[:notice]
|
||||
|
||||
# Verify the transfer was actually destroyed
|
||||
assert_raises(ActiveRecord::RecordNotFound) do
|
||||
transfer.reload
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user