describe Redshifter::Job::AppendRedshiftTableJob do
  describe '.perform' do
    it 'should call the rake task via Dynosaur' do
      dynosaur = double
      expect(dynosaur).to receive(:start)

      expect(Dynosaur::Process::Heroku).to receive(:new)
                                             .with(task: 'redshifter:append',
                                                   args: ['my_table'])
                                             .and_return(dynosaur)

      Redshifter::Job::AppendRedshiftTableJob.perform('my_table')
    end
  end
end
