Skip to content

Instantly share code, notes, and snippets.

@wojtekmach
Last active December 10, 2015 00:39
Show Gist options
  • Select an option

  • Save wojtekmach/4353110 to your computer and use it in GitHub Desktop.

Select an option

Save wojtekmach/4353110 to your computer and use it in GitHub Desktop.
describe 'Notifier' do
before do
SMS.stub(:deliver)
Expense.stub(:create)
@user = double 'user', mobile_number: '1234'
@message = 'hello'
Notifier.notify(@user, @message)
end
it 'delivers SMS' do
SMS.should have_received(:deliver).with(@user.mobile_number, @message)
end
it 'records SMS expense' do
Expense.should have_received(:create).with(:sms)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment