test: improve users edit tests

- Rename test for friendly forwarding to be more concise
- Add a separate test for successful user edit

These changes enhance the clarity of the test suite by
providing a more descriptive name for the friendly forwarding
test and separating the successful edit functionality into
its own test case, improving maintainability and readability.
This commit is contained in:
songtianlun 2025-01-04 10:26:08 +08:00
parent 712cd10894
commit 119a34faae

View File

@ -15,10 +15,15 @@ class UsersEditTest < ActionDispatch::IntegrationTest
assert_redirected_to user_url(@user)
end
test "successful edit with friendly forwarding" do
test "friendly forwarding" do
get edit_user_path(@user)
log_in_as(@user)
assert_redirected_to edit_user_url(@user)
end
test "successful edit" do
log_in_as(@user)
get edit_user_path(@user)
assert_template "users/edit"
name = "Foo Bae"
email = "foo@bar.com"