Sha256: c0cfd9f2712688092d996a111fe427ac4cd17de68fa9de1c43ba35c9cdc54aff

Contents?: true

Size: 1.19 KB

Versions: 31

Compression:

Stored size: 1.19 KB

Contents

require 'spec_helper.rb'

describe Paypal::Payment::Response::Info do
  let :attributes do
    {
      :NAME => 'Item Name',
      :DESC => 'Item Description',
      :QTY => '1',
      :NUMBER => '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' }
    its(:number) { should == '1' }

    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

31 entries across 31 versions & 3 rubygems

Version Path
creative-paypal-express-1.4.1 spec/paypal/payment/response/item_spec.rb
creative-paypal-express-1.4.0 spec/paypal/payment/response/item_spec.rb
creative-paypal-express-1.3.0 spec/paypal/payment/response/item_spec.rb
creative-paypal-express-1.2.1 spec/paypal/payment/response/item_spec.rb
creative-paypal-express-1.2.0 spec/paypal/payment/response/item_spec.rb
creative-paypal-express-1.1.0 spec/paypal/payment/response/item_spec.rb
dfg-paypal-0.8.2 spec/paypal/payment/response/item_spec.rb
creative-paypal-express-1.0.1.dev2 spec/paypal/payment/response/item_spec.rb
creative-paypal-express-1.0.1.dev1 spec/paypal/payment/response/item_spec.rb
creative-paypal-express-1.0.0 spec/paypal/payment/response/item_spec.rb
creative-paypal-express-0.8.2.4 spec/paypal/payment/response/item_spec.rb
creative-paypal-express-0.8.2.3 spec/paypal/payment/response/item_spec.rb
creative-paypal-express-0.8.2.2 spec/paypal/payment/response/item_spec.rb
creative-paypal-express-0.8.2.1 spec/paypal/payment/response/item_spec.rb
creative-paypal-express-0.8.2 spec/paypal/payment/response/item_spec.rb
creative-paypal-express-0.8.1 spec/paypal/payment/response/item_spec.rb
paypal-express-0.8.1 spec/paypal/payment/response/item_spec.rb
paypal-express-0.8.0 spec/paypal/payment/response/item_spec.rb
paypal-express-0.7.1 spec/paypal/payment/response/item_spec.rb
paypal-express-0.7.0 spec/paypal/payment/response/item_spec.rb