admin: fix the new-user username placeholder
The username field's attributes were emitted as one string through <%= %>, which HTML-escapes the quotes, so the browser read the placeholder as the literal "leave and dropped the rest. Write the attributes in the template and test the rendered field. Assisted-by: Claude:opus-5
This commit is contained in:
parent
33ba7650c3
commit
7e262b8f89
2 changed files with 10 additions and 1 deletions
|
|
@ -49,6 +49,9 @@ class UsersAdminTest < Minitest::Test
|
|||
|
||||
def test_invite_without_username_lets_invitee_choose
|
||||
admin_login!
|
||||
get '/admin/users/new'
|
||||
assert_includes last_response.body, 'placeholder="empty: the invitee picks one"' # not HTML-escaped into the attribute
|
||||
refute_includes last_response.body, '"'
|
||||
create_user(username: '', perm: { 'bingo' => { 'read' => '1' } })
|
||||
u = User.where(choose_username: true).first
|
||||
assert_match(/\Ainvite-[0-9a-f]{8}\z/, u.username)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue