spec/paypal/payment/request_spec.rb in paypal-express-0.2.4 vs spec/paypal/payment/request_spec.rb in paypal-express-0.2.5
- old
+ new
@@ -1,15 +1,16 @@
require 'spec_helper.rb'
describe Paypal::Payment::Request do
let :instant_request do
Paypal::Payment::Request.new(
- :amount => 10.25,
+ :amount => 20.5,
:currency_code => :JPY,
:description => 'Instant Payment Request',
:notify_url => 'http://merchant.example.com/notify',
:items => [{
+ :quantity => 2,
:name => 'Item1',
:description => 'Awesome Item!',
:amount => 10.25
}]
)
@@ -23,11 +24,11 @@
)
end
describe '.new' do
it 'should handle Instant Payment parameters' do
- instant_request.amount.should == 10.25
+ instant_request.amount.should == 20.5
instant_request.currency_code.should == :JPY
instant_request.description.should == 'Instant Payment Request'
instant_request.notify_url.should == 'http://merchant.example.com/notify'
end
@@ -39,18 +40,18 @@
end
describe '#to_params' do
it 'should handle Instant Payment parameters' do
instant_request.to_params.should == {
- :PAYMENTREQUEST_0_AMT => "10.25",
+ :PAYMENTREQUEST_0_AMT => "20.50",
:PAYMENTREQUEST_0_CURRENCYCODE => :JPY,
:PAYMENTREQUEST_0_DESC => "Instant Payment Request",
:PAYMENTREQUEST_0_NOTIFYURL => "http://merchant.example.com/notify",
- :PAYMENTREQUEST_0_ITEMAMT => "10.25",
+ :PAYMENTREQUEST_0_ITEMAMT => "20.50",
:L_PAYMENTREQUEST_0_NAME0 => "Item1",
:L_PAYMENTREQUEST_0_DESC0 => "Awesome Item!",
:L_PAYMENTREQUEST_0_AMT0 => "10.25",
- :L_PAYMENTREQUEST_0_QTY0 => 1
+ :L_PAYMENTREQUEST_0_QTY0 => 2
}
end
it 'should handle Recurring Payment parameters' do
recurring_request.to_params.should == {