signup_spec.rb 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe 'Signup', authenticated_as: false, type: :system do
  4. before do
  5. visit 'signup'
  6. end
  7. it 'creates an account successfully' do
  8. fill_in 'firstname', with: 'Test'
  9. fill_in 'lastname', with: 'Test'
  10. fill_in 'email', with: 'test@example.com'
  11. fill_in 'password', with: 'SOme-pass1'
  12. fill_in 'password_confirm', with: 'SOme-pass1'
  13. click '.js-submit'
  14. expect(page).to have_css '.signup', text: 'Registration successful!'
  15. end
  16. it 'with a weak password show password strength error' do
  17. fill_in 'firstname', with: 'Test'
  18. fill_in 'lastname', with: 'Test'
  19. fill_in 'email', with: 'test@example.com'
  20. fill_in 'password', with: 'asdasdasdasd'
  21. fill_in 'password_confirm', with: 'asdasdasdasd'
  22. click '.js-submit'
  23. within '.js-danger' do
  24. expect(page).to have_text('Invalid password,').and(have_no_text('["'))
  25. end
  26. end
  27. end