2019-10-15 05:06:09 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-03-21 09:36:46 -04:00
|
|
|
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-05-29 08:07:48 -04:00
|
|
|
it 'changes the incoming email token' do
|
2017-03-21 09:36:46 -04:00
|
|
|
expect { run_rake_task('tokens:reset_all_email') }.to change { user.reload.incoming_email_token }
|
|
|
|
end
|
|
|
|
end
|
2017-05-23 08:09:45 -04:00
|
|
|
|
2018-05-31 10:01:04 -04:00
|
|
|
describe 'reset_all_feed task' do
|
2019-05-29 08:07:48 -04:00
|
|
|
it 'changes the feed token for the user' do
|
2018-05-31 10:01:04 -04:00
|
|
|
expect { run_rake_task('tokens:reset_all_feed') }.to change { user.reload.feed_token }
|
2017-05-23 08:09:45 -04:00
|
|
|
end
|
|
|
|
end
|
2017-03-21 09:36:46 -04:00
|
|
|
end
|