Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- describe Cart, 'when checking if a cart is finalized' do
- before(:each) do
- @cart = Cart.new
- @cart.stub!(:clicked_finalized?).and_return(true)
- @cart.stub!(:total_final_invoice).and_return("10.50")
- end
- it 'will not be finalized if the customer has not clicked finalized' do
- @cart.stub!(:clicked_finalized?).and_return(false)
- @cart.should_not be_finalized
- end
- it 'will not be finalized if the final price is more than zero and the customer has not been charged' do
- @cart.should_not be_finalized
- end
- it 'will be finalized if finalized is clicked and price is zero' do
- @cart.stub!(:total_final_invoice).and_return("")
- @cart.should be_finalized
- end
- it 'will be finalized if finalized is clicked and the customer is charged' do
- @cart.stub!(:charged_on).and_return(Time.now)
- @cart.should be_finalized
- end
- end
Add Comment
Please, Sign In to add comment