Guest User

Untitled

a guest
Apr 24th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. require File.dirname(__FILE__) + '/../spec_helper'
  2.  
  3. describe CartItem do
  4.  
  5. before(:each) do
  6. @service = Service.new
  7. @service.name = "Hostingas metams"
  8. @service.price = 260
  9. @service.active = 1
  10.  
  11. @cart_item = CartItem.new(@service)
  12. end
  13.  
  14. it "should get service as parameter when created" do
  15. CartItem.should_receive(:new).with(@service)
  16. end
  17.  
  18. it "should initially have service and quantity" do
  19. @cart_item.should_not be_nil
  20. @cart_item.should_not be_nil
  21. end
  22.  
  23.  
  24. it "should initially have quantity 1" do
  25. @cart_item.quantity.should eql(1)
  26. end
  27.  
  28. it "should add service if service not included yet"
  29.  
  30. it "should increment quantity of service if it was already added"
  31.  
  32. it "should remove service if it's the last one"
  33.  
  34. it "should decrement quantity of service if it's not the last one"
  35.  
  36. end
Add Comment
Please, Sign In to add comment