authentication_spec.rb 595 B

12345678910111213141516171819202122232425262728
  1. require 'rails_helper'
  2. RSpec.describe 'Authentication', type: :system do
  3. it 'Login', authenticated: false do
  4. login(
  5. username: 'master@example.com',
  6. password: 'test',
  7. )
  8. expect_current_route 'dashboard'
  9. end
  10. it 'Logout' do
  11. logout
  12. expect_current_route 'login', wait: 2
  13. end
  14. it 'will unset user attributes after logout' do
  15. logout
  16. expect_current_route 'login', wait: 2
  17. visit '/#signup'
  18. # check wrong displayed fields in registration form after logout. #2989
  19. expect(page).to have_no_selector('select[name=organization_id]')
  20. end
  21. end