debian-mirror-gitlab/spec/tasks/tokens_spec.rb

24 lines
583 B
Ruby
Raw Normal View History

2019-12-21 20:55:43 +05:30
# frozen_string_literal: true
2017-08-17 22:00:37 +05:30
require 'rake_helper'
describe 'tokens rake tasks' do
let!(:user) { create(:user) }
before do
Rake.application.rake_require 'tasks/tokens'
end
describe 'reset_all_email task' do
2019-09-04 21:01:54 +05:30
it 'changes the incoming email token' do
2017-08-17 22:00:37 +05:30
expect { run_rake_task('tokens:reset_all_email') }.to change { user.reload.incoming_email_token }
end
end
2017-09-10 17:25:29 +05:30
2018-11-08 19:23:39 +05:30
describe 'reset_all_feed task' do
2019-09-04 21:01:54 +05:30
it 'changes the feed token for the user' do
2018-11-08 19:23:39 +05:30
expect { run_rake_task('tokens:reset_all_feed') }.to change { user.reload.feed_token }
2017-09-10 17:25:29 +05:30
end
end
2017-08-17 22:00:37 +05:30
end