Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/tasks/gitlab/password_rake_spec.rb')
-rw-r--r--spec/tasks/gitlab/password_rake_spec.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/spec/tasks/gitlab/password_rake_spec.rb b/spec/tasks/gitlab/password_rake_spec.rb
index 21a6dc102e6..2b7056344d3 100644
--- a/spec/tasks/gitlab/password_rake_spec.rb
+++ b/spec/tasks/gitlab/password_rake_spec.rb
@@ -1,9 +1,9 @@
# frozen_string_literal: true
-require 'rake_helper'
+require 'spec_helper'
RSpec.describe 'gitlab:password rake tasks', :silence_stdout do
- let!(:user_1) { create(:user, username: 'foobar', password: User.random_password) }
+ let!(:user_1) { create(:user, username: 'foobar', password: User.random_password, password_automatically_set: true) }
let(:password) { User.random_password }
def stub_username(username)
@@ -26,8 +26,14 @@ RSpec.describe 'gitlab:password rake tasks', :silence_stdout do
describe ':reset' do
context 'when all inputs are correct' do
it 'updates the password properly' do
+ expect(user_1.password_automatically_set?).to eq(true)
+
run_rake_task('gitlab:password:reset', user_1.username)
- expect(user_1.reload.valid_password?(password)).to eq(true)
+
+ user_1.reload
+
+ expect(user_1.valid_password?(password)).to eq(true)
+ expect(user_1.password_automatically_set?).to eq(false)
end
end