mirror of
https://github.com/internetee/registry.git
synced 2025-08-01 15:34:41 +02:00
Added assertions for failded zone update messages
This commit is contained in:
parent
ffec4fd403
commit
249aad16b7
1 changed files with 5 additions and 4 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue