daily pastebin goal
16%
SHARE
TWEET

Untitled

a guest May 17th, 2018 97 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. describe Cart, 'when checking if a cart is finalized' do
  2.   before(:each) do
  3.     @cart = Cart.new
  4.     @cart.stub!(:clicked_finalized?).and_return(true)
  5.     @cart.stub!(:total_final_invoice).and_return("10.50")
  6.   end
  7.  
  8.   it 'will not be finalized if the customer has not clicked finalized' do
  9.     @cart.stub!(:clicked_finalized?).and_return(false)
  10.     @cart.should_not be_finalized
  11.   end
  12.  
  13.   it 'will not be finalized if the final price is more than zero and the customer has not been charged' do
  14.     @cart.should_not be_finalized
  15.   end
  16.  
  17.   it 'will be finalized if finalized is clicked and price is zero' do
  18.     @cart.stub!(:total_final_invoice).and_return("")
  19.     @cart.should be_finalized
  20.   end
  21.  
  22.   it 'will be finalized if finalized is clicked and the customer is charged' do
  23.     @cart.stub!(:charged_on).and_return(Time.now)
  24.     @cart.should be_finalized
  25.   end
  26. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top