Sha256: d7ccd809c3a49815051912bcf4ee2796e2461c9b0a3fe884d7cba5d2b9f943e7

Contents?: true

Size: 883 Bytes

Versions: 3

Compression:

Stored size: 883 Bytes

Contents

# encoding: utf-8

describe Akatus::Item do

  let(:attrs) {
    {
      :reference     => 'ABC1234567',
      :description   => 'Caixa de bombons sortidos',
      :quantity      => 32,
      :price         => BigDecimal.new('32.2'),
      :weight        => BigDecimal.new('2.25'),
      :shipping_cost => BigDecimal.new(9),
    }
  }

  let(:payload) {
    {
      'produto' => {
        'codigo'     => 'ABC1234567',
        'descricao'  => 'Caixa de bombons sortidos',
        'quantidade' => '32',
        'preco'      => '32.20',
        'peso'       => '2.25',
        'frete'      => '9.00',
        'desconto'   => '0.00'
      }
    }
  }

  it_behaves_like Akatus::Transferrable

  it "has default values" do

    item = Akatus::Item.new
    item.shipping_cost.should == 0
    item.discount.should == 0
    item.weight.should == 0
    item.quantity.should == 1

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
akatus-1.0.2 spec/item_spec.rb
akatus-1.0.1 spec/item_spec.rb
akatus-1.0.0 spec/item_spec.rb