mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
fix build & add migration to clear common passwords cache
This commit is contained in:
parent
341037d6fb
commit
8d4bac7da2
3 changed files with 10 additions and 4 deletions
|
@ -0,0 +1,7 @@
|
|||
require "common_passwords/common_passwords"
|
||||
|
||||
class ClearCommonPasswordsCache < ActiveRecord::Migration
|
||||
def change
|
||||
$redis.without_namespace.del CommonPasswords::LIST_KEY
|
||||
end
|
||||
end
|
|
@ -21,7 +21,6 @@ class CommonPasswords
|
|||
password_list.include?(password)
|
||||
end
|
||||
|
||||
|
||||
private
|
||||
|
||||
class RedisPasswordList
|
||||
|
|
|
@ -333,7 +333,7 @@ describe UsersController do
|
|||
old_token = user.auth_token
|
||||
|
||||
get :password_reset, token: token
|
||||
put :password_reset, token: token, password: 'newpassword'
|
||||
put :password_reset, token: token, password: 'hg9ow8yhg98o'
|
||||
expect(response).to be_success
|
||||
expect(assigns[:error]).to be_blank
|
||||
|
||||
|
@ -372,14 +372,14 @@ describe UsersController do
|
|||
end
|
||||
|
||||
it "logs in the user" do
|
||||
put :password_reset, token: token, password: 'newpassword'
|
||||
put :password_reset, token: token, password: 'ksjafh928r'
|
||||
expect(assigns(:user).errors).to be_blank
|
||||
expect(session[:current_user_id]).to be_present
|
||||
end
|
||||
|
||||
it "doesn't log in the user when not approved" do
|
||||
SiteSetting.expects(:must_approve_users?).returns(true)
|
||||
put :password_reset, token: token, password: 'newpassword'
|
||||
put :password_reset, token: token, password: 'ksjafh928r'
|
||||
expect(assigns(:user).errors).to be_blank
|
||||
expect(session[:current_user_id]).to be_blank
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue