summaryrefslogtreecommitdiff
path: root/spec/unit/customer_spec.rb
blob: 08f387bb8cd8cb09ef81d00f2e37eb2353b9374a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
require "spec_helper"

describe Customer do
  let(:cart) { fake }
  let(:sut) { Customer.new(cart) }

  context "when adding an item to the cart" do
    let(:product) { fake }

    before :each do
      sut.add_to_cart(product)
    end

    it "should add it to the cart" do
      cart.should have_received(:add, product)
    end
  end
end