Sha256: cbccdf5326d8c53cb32037615f31b147dc1aae76f73b415784c8aed553b3403a

Contents?: true

Size: 900 Bytes

Versions: 2

Compression:

Stored size: 900 Bytes

Contents

require 'spec_helper'

describe Voicemail::MailboxCleanerController do
  include VoicemailControllerSpecHelper
  describe "#run" do
    context "new messages" do
      subject { flexmock(Voicemail::MailboxCleanerController.new call, {new_or_saved: :new}) }
      it 'should call #menu with the proper arguments' do
        subject.should_receive(:menu).with(config.mailbox.clear_new_messages, 
          { timeout: config.menu_timeout, tries: config.menu_tries }, Proc)
        subject.run
      end
    end

    context "saved messages" do
      subject { flexmock(Voicemail::MailboxCleanerController.new call, {new_or_saved: :saved}) }
      it 'should call #menu with the proper arguments' do
        subject.should_receive(:menu).with(config.mailbox.clear_saved_messages, 
          { timeout: config.menu_timeout, tries: config.menu_tries }, Proc)
        subject.run
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
voicemail-1.1.1 spec/voicemail/call_controllers/mailbox_cleaner_controller_spec.rb
voicemail-1.1.0 spec/voicemail/call_controllers/mailbox_cleaner_controller_spec.rb