Sha256: 99cea88ffb44a88f72f780a5e3f04c8907b3d46c5a28063ce09340a16b9ad75e

Contents?: true

Size: 1.14 KB

Versions: 15

Compression:

Stored size: 1.14 KB

Contents

require 'spec_helper.rb'

describe Paypal::Payment::Response::Info do
  let :attributes do
    {
      :NAME => 'Item Name',
      :DESC => 'Item Description',
      :QTY => '1',
      :ITEMCATEGORY => 'Digital',
      :ITEMWIDTHVALUE => '1.0',
      :ITEMHEIGHTVALUE => '2.0',
      :ITEMLENGTHVALUE => '3.0',
      :ITEMWEIGHTVALUE => '4.0'
    }
  end

  describe '.new' do
    subject { Paypal::Payment::Response::Item.new(attributes) }
    its(:name) { should == 'Item Name' }
    its(:description) { should == 'Item Description' }
    its(:quantity) { should == 1 }
    its(:category) { should == 'Digital' }
    its(:width) { should == '1.0' }
    its(:height) { should == '2.0' }
    its(:length) { should == '3.0' }
    its(:weight) { should == '4.0' }

    context 'when non-supported attributes are given' do
      it 'should ignore them and warn' do
        _attr_ = attributes.merge(
          :ignored => 'Ignore me!'
        )
        Paypal.logger.should_receive(:warn).with(
          "Ignored Parameter (Paypal::Payment::Response::Item): ignored=Ignore me!"
        )
        Paypal::Payment::Response::Item.new _attr_
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
paypal-express-0.4.4 spec/paypal/payment/response/item_spec.rb
paypal-express-0.4.3 spec/paypal/payment/response/item_spec.rb
paypal-express-0.4.2 spec/paypal/payment/response/item_spec.rb
paypal-express-0.4.1 spec/paypal/payment/response/item_spec.rb
paypal-express-0.4.0 spec/paypal/payment/response/item_spec.rb
paypal-express-0.4.0.alpha spec/paypal/payment/response/item_spec.rb
paypal-express-0.3.1 spec/paypal/payment/response/item_spec.rb
paypal-express-0.3.0 spec/paypal/payment/response/item_spec.rb
paypal-express-0.2.10 spec/paypal/payment/response/item_spec.rb
paypal-express-0.2.9 spec/paypal/payment/response/item_spec.rb
paypal-express-0.2.8 spec/paypal/payment/response/item_spec.rb
paypal-express-0.2.7 spec/paypal/payment/response/item_spec.rb
paypal-express-0.2.6 spec/paypal/payment/response/item_spec.rb
paypal-express-0.2.5 spec/paypal/payment/response/item_spec.rb
paypal-express-0.2.4 spec/paypal/payment/response/item_spec.rb