disable_login_form_spec.rb 831 B

123456789101112131415161718192021222324252627282930
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe 'Disable login form', authenticated_as: false, type: :system do
  4. context 'with enable password login form' do
  5. before { Setting.set 'user_show_password_login', true }
  6. it 'shows login form' do
  7. visit '/'
  8. expect(page).to have_css('#login')
  9. end
  10. end
  11. context 'with disable default login form' do
  12. before { Setting.set 'user_show_password_login', false }
  13. it 'show login form when no third application enable' do
  14. Setting.set 'auth_saml', false
  15. visit '/'
  16. expect(page).to have_css('#login')
  17. end
  18. it 'show hide form when third application' do
  19. Setting.set 'auth_saml', true
  20. visit '/'
  21. expect(page).to have_no_selector('#login')
  22. end
  23. end
  24. end