Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'spec_helper'
- describe WithdrawTransactionsController do
- login_user
- let(:user) { Factory.stub :user }
- let(:transaction_attrs) { {'amount' => '199.99'} }
- let(:withdraw_transaction) { Factory.stub :withdraw_transaction }
- describe "POST 'create'" do
- before(:each) do
- controller.stubs(:current_user).returns(user)
- end
- it "should create WithdrawTransaction" do
- WithdrawTransaction.expects(:new).with(transaction_attrs).returns(withdraw_transaction)
- do_post
- end
- def do_post
- post 'create', withdraw_transaction: transaction_attrs
- end
- end
- end
Add Comment
Please, Sign In to add comment