diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 17:34:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 17:34:42 +0300 |
commit | 9f46488805e86b1bc341ea1620b866016c2ce5ed (patch) | |
tree | f9748c7e287041e37d6da49e0a29c9511dc34768 /spec/controllers/sessions_controller_spec.rb | |
parent | dfc92d081ea0332d69c8aca2f0e745cb48ae5e6d (diff) |
Add latest changes from gitlab-org/gitlab@13-0-stable-ee
Diffstat (limited to 'spec/controllers/sessions_controller_spec.rb')
-rw-r--r-- | spec/controllers/sessions_controller_spec.rb | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/spec/controllers/sessions_controller_spec.rb b/spec/controllers/sessions_controller_spec.rb index af2e452c0ca..a65698a5b56 100644 --- a/spec/controllers/sessions_controller_spec.rb +++ b/spec/controllers/sessions_controller_spec.rb @@ -41,10 +41,10 @@ describe SessionsController do stub_ldap_setting(enabled: true) end - it 'assigns ldap_servers' do + it 'ldap_servers available in helper' do get(:new) - expect(assigns[:ldap_servers].first.to_h).to include('label' => 'ldap', 'provider_name' => 'ldapmain') + expect(subject.ldap_servers.first.to_h).to include('label' => 'ldap', 'provider_name' => 'ldapmain') end context 'with sign_in disabled' do @@ -52,10 +52,10 @@ describe SessionsController do stub_ldap_setting(prevent_ldap_sign_in: true) end - it 'assigns no ldap_servers' do + it 'no ldap_servers available in helper' do get(:new) - expect(assigns[:ldap_servers]).to eq [] + expect(subject.ldap_servers).to eq [] end end end @@ -99,6 +99,11 @@ describe SessionsController do set_devise_mapping(context: @request) end + it_behaves_like 'known sign in' do + let(:user) { create(:user) } + let(:post_action) { post(:create, params: { user: { login: user.username, password: user.password } }) } + end + context 'when using standard authentications' do context 'invalid password' do it 'does not authenticate user' do |