Sha256: fe84f135fc73df064364960d86f4dc8d7c570034396fa6db27729d0789a7ec8e
Contents?: true
Size: 1.24 KB
Versions: 1
Compression:
Stored size: 1.24 KB
Contents
require 'spec_helper' include PayPal::AdaptivePayments describe PayPal::AdaptivePayments::Preapproval do let(:starting_date) { Date.today } describe "#create" do context "when successful" do use_vcr_cassette "adaptive_payments/preapproval/create/success"#, :record => :all let(:preapproval) { Preapproval.new( :client_details => { :ip_address => "234.8.8.18", :device_id => "123456", :application_id => "PP" }, :starting_date => starting_date, :currency_code => 'USD', :max_total_amount_of_all_payments => 2000.0, :cancel_url => 'http://dss.example.com/cancel?preapprovalkey=${preapprovalkey}', :return_url => 'http://dss.example.com/accepted?preapprovalkey=${preapprovalkey}' ) } subject { preapproval.create } before { subject } it "sets preapproval_key" do preapproval.preapproval_key.should eql(subject.preapproval_key) end its(:success?) { should be_true } its(:preapproval_key) { should_not be_nil } its(:preapproval_url) { should eql("https://www.sandbox.paypal.com/webscr?cmd=_ap-preapproval&preapprovalkey=#{preapproval.preapproval_key}") } end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
paypal-payment-0.1.2 | spec/paypal/adaptive_payments/preapproval/create_spec.rb |