Added assertions for failded zone update messages

This commit is contained in:
mmeest 2025-06-26 13:09:16 +03:00
parent ffec4fd403
commit 249aad16b7

View file

@ -76,14 +76,15 @@ class AdminAreaZonesIntegrationTest < ApplicationIntegrationTest
end end
def test_fails_to_update_zone_with_invalid_data def test_fails_to_update_zone_with_invalid_data
patch admin_zone_path(@zone), params: { zone: { origin: '' }} patch admin_zone_path(@zone), params: { zone: { ttl: '' }}
assert_response :success assert_response :success
assert_includes response.body, '<form', "'form' element not found after invalid update" assert_includes response.body, "Ttl", "Ttl field error should be shown"
assert_includes response.body, "Ttl is missing", "Presence validation message expected"
@zone.reload @zone.reload
assert_not_equal '', @zone.origin refute_equal '', @zone.ttl, "Ttl should not have changed"
end end
def test_redirects_to_index_after_successful_operations def test_redirects_to_index_after_successful_operations