Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require File.dirname(__FILE__) + '/../spec_helper'
- describe CartItem do
- before(:each) do
- @service = Service.new
- @service.name = "Hostingas metams"
- @service.price = 260
- @service.active = 1
- @cart_item = CartItem.new(@service)
- end
- it "should get service as parameter when created" do
- CartItem.should_receive(:new).with(@service)
- end
- it "should initially have service and quantity" do
- @cart_item.should_not be_nil
- @cart_item.should_not be_nil
- end
- it "should initially have quantity 1" do
- @cart_item.quantity.should eql(1)
- end
- it "should add service if service not included yet"
- it "should increment quantity of service if it was already added"
- it "should remove service if it's the last one"
- it "should decrement quantity of service if it's not the last one"
- end
Add Comment
Please, Sign In to add comment