summaryrefslogtreecommitdiff
path: root/spec/tasks/tokens_spec.rb
blob: 51f7a536cbb98c9bfab9b831a3f9e9f9eb257c6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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_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

  describe 'reset_all_rss task' do
    it 'invokes create_hooks task' do
      expect { run_rake_task('tokens:reset_all_rss') }.to change { user.reload.rss_token }
    end
  end
end