Sha256: 6788b1f84382067df8f6b75dfea99980040ab2a62d2c5f83fa4c0c7ab0ce2e9d

Contents?: true

Size: 937 Bytes

Versions: 3

Compression:

Stored size: 937 Bytes

Contents

describe WorkerHelpers do
  include WorkerHelpers
  let(:id) { 'foo' }
  let(:data) {'bar'}
  let(:address) {'test@test.com'}
  
  it 'gets from store' do
    expect(::CuttingEdge::App.store).to receive(:[]).with(id).and_return(true)
    expect(get_from_store(id)).to be true
  end
  
  it 'deletes from store' do
    expect(::CuttingEdge::App.store).to receive(:delete).with(id).and_return(true)
    expect(delete_from_store(id)).to eq true
  end
  
  it 'adds to store' do
    expect(::CuttingEdge::App.store).to receive(:[]=).with(id, data).and_return(data)
    expect(add_to_store(id, data)).to eq data
  end
  
  it 'runs BadgeWorker' do
    expect(BadgeWorker).to receive(:perform_async).with(id).and_return(true)
    expect(badge_worker(id)).to eq true
  end
  
  it 'runs MailWorker' do
    expect(MailWorker).to receive(:perform_async).with(id, address).and_return(true)
    expect(mail_worker(id, address)).to eq true
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cutting_edge-0.3 spec/worker_helper_spec.rb
cutting_edge-0.2.1 spec/worker_helper_spec.rb
cutting_edge-0.2 spec/worker_helper_spec.rb