diff options
author | James Lopez <james@gitlab.com> | 2017-03-21 13:36:46 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-03-21 13:36:46 +0000 |
commit | b356ce7e12e8ffbf19754908ffad2660aec9a07c (patch) | |
tree | 08583cf41c66c52be9ac42cf3adcb66a09f6a888 /spec/tasks | |
parent | 4ebc62391dea489935af80291363d76e67a64336 (diff) | |
download | gitlab-ce-b356ce7e12e8ffbf19754908ffad2660aec9a07c.tar.gz |
Add a rake task to reset all email and private tokens
Diffstat (limited to 'spec/tasks')
-rw-r--r-- | spec/tasks/tokens_spec.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/tasks/tokens_spec.rb b/spec/tasks/tokens_spec.rb new file mode 100644 index 00000000000..19036c7677c --- /dev/null +++ b/spec/tasks/tokens_spec.rb @@ -0,0 +1,21 @@ +require 'rake_helper' + +describe 'tokens rake tasks' do + let!(:user) { create(:user) } + + before do + Rake.application.rake_require 'tasks/tokens' + end + + describe 'reset_all task' do + it 'invokes create_hooks task' do + expect { run_rake_task('tokens:reset_all_auth') }.to change { user.reload.authentication_token } + end + end + + describe 'reset_all_email task' do + it 'invokes create_hooks task' do + expect { run_rake_task('tokens:reset_all_email') }.to change { user.reload.incoming_email_token } + end + end +end |