diff options
author | Robert Speicher <rspeicher@gmail.com> | 2016-03-02 17:48:49 -0500 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2016-03-04 17:37:57 -0500 |
commit | 599a6d78737237e806dcfe0105b8b81dc696b71f (patch) | |
tree | 3bf899a3729ffcf36690634cc72e5a09ebf83061 /spec/features | |
parent | ec68d673b24687804b1e1aa4c86b2f8fbc9ba7fd (diff) | |
download | gitlab-ce-599a6d78737237e806dcfe0105b8b81dc696b71f.tar.gz |
Allow the initial admin to set a passwordrs-no-default-credentials
Closes #1980
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/login_spec.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/features/login_spec.rb b/spec/features/login_spec.rb index dac9205449a..4433ef2d6f1 100644 --- a/spec/features/login_spec.rb +++ b/spec/features/login_spec.rb @@ -1,6 +1,32 @@ require 'spec_helper' feature 'Login', feature: true do + describe 'initial login after setup' do + it 'allows the initial admin to create a password' do + # This behavior is dependent on there only being one user + User.delete_all + + user = create(:admin, password_automatically_set: true) + + visit root_path + expect(current_path).to eq edit_user_password_path + expect(page).to have_content('Please create a password for your new account.') + + fill_in 'user_password', with: 'password' + fill_in 'user_password_confirmation', with: 'password' + click_button 'Change your password' + + expect(current_path).to eq new_user_session_path + expect(page).to have_content(I18n.t('devise.passwords.updated_not_active')) + + fill_in 'user_login', with: user.username + fill_in 'user_password', with: 'password' + click_button 'Sign in' + + expect(current_path).to eq root_path + end + end + describe 'with two-factor authentication' do context 'with valid username/password' do let(:user) { create(:user, :two_factor) } |