-
Notifications
You must be signed in to change notification settings - Fork 19
added new tests for zones_controller #2813
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
get new_admin_zone_path | ||
assert_response :success | ||
|
||
unless response.body.include?('<form') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this block. It is okey, when you debug by yourself, but when code is completed, some debug approaches need to remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
puts response.body | ||
end | ||
|
||
assert_includes response.body, '<form', "'form' element not found" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly, this looks more like a test for an error or something along those lines. Correct me if I’m wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just too eager. Removed.
get admin_zones_path | ||
assert_response :success | ||
|
||
unless response.body.include?('<table') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove debug block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
puts response.body | ||
end | ||
|
||
assert_includes response.body, '<table', "'table' element not found" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
???
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
follow_redirect! | ||
assert_response :success | ||
|
||
# If the table is not found in response body, print the response body |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
puts response.body | ||
end | ||
|
||
assert_includes response.body, '<form', "'form' element not found" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
def test_shows_edit_form | ||
get edit_admin_zone_path(@zone) | ||
assert_response :success | ||
assert_includes response.body, '<form', "'form' element not found in edit form" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we have some problem in UI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No., everything looks good on UI side. Removed.
assert_response :success | ||
|
||
# If the form is not found in response body, print the response body | ||
unless response.body.include?('<form') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
puts response.body | ||
end | ||
|
||
assert_includes response.body, '<form', "'form' element not found after invalid update" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if update is invalid, we should get notification about it. And this notification need to check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added validation.
} | ||
} | ||
|
||
assert_redirected_to admin_zones_url |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check manually it. Do we receive some notification after this operation? If we do, then also need to add one more assertion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added assertion.
New tests for zones_controller