2018-12-19 14:47:15 +00:00
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
RSpec.describe 'Authentication', type: :system do
|
|
|
|
|
2020-06-18 11:51:25 +00:00
|
|
|
it 'Login', authenticated_as: false do
|
2018-12-19 14:47:15 +00:00
|
|
|
login(
|
|
|
|
username: 'master@example.com',
|
|
|
|
password: 'test',
|
|
|
|
)
|
|
|
|
|
2019-01-14 15:31:31 +00:00
|
|
|
expect_current_route 'dashboard'
|
2018-12-19 14:47:15 +00:00
|
|
|
end
|
|
|
|
|
2019-04-15 01:41:17 +00:00
|
|
|
it 'Logout' do
|
2018-12-19 14:47:15 +00:00
|
|
|
logout
|
2019-01-14 15:31:31 +00:00
|
|
|
expect_current_route 'login', wait: 2
|
2018-12-19 14:47:15 +00:00
|
|
|
end
|
2020-03-25 10:46:19 +00:00
|
|
|
|
|
|
|
it 'will unset user attributes after logout' do
|
|
|
|
logout
|
|
|
|
expect_current_route 'login', wait: 2
|
|
|
|
|
|
|
|
visit '/#signup'
|
|
|
|
|
|
|
|
# check wrong displayed fields in registration form after logout. #2989
|
2020-04-14 13:24:17 +00:00
|
|
|
expect(page).to have_no_selector('select[name=organization_id]')
|
2020-03-25 10:46:19 +00:00
|
|
|
end
|
2018-12-19 14:47:15 +00:00
|
|
|
end
|