Sha256: 4652473fce0563b106107a41f6587dd0faac931cda42d6b500615fbb392e9c15

Contents?: true

Size: 761 Bytes

Versions: 3

Compression:

Stored size: 761 Bytes

Contents

require 'spec_helper'

module Payday
  describe LineItem do
    it "should be able to be initilized with a price" do
      li = LineItem.new(:price => BigDecimal.new("20"))
      expect(li.price).to eq(BigDecimal.new("20"))
    end

    it "should be able to be initialized with a quantity" do
      li = LineItem.new(:quantity => 30)
      expect(li.quantity).to eq(BigDecimal.new("30"))
    end

    it "should be able to be initlialized with a description" do
      li = LineItem.new(:description => "12 Pairs of Pants")
      expect(li.description).to eq("12 Pairs of Pants")
    end

    it "should return the correct amount" do
      li = LineItem.new(:price => 10, :quantity => 12)
      expect(li.amount).to eq(BigDecimal.new("120"))
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
payday-1.1.3 spec/line_item_spec.rb
payday-1.1.2 spec/line_item_spec.rb
payday-1.1.1 spec/line_item_spec.rb