Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

36 lines (31 sloc) 0.919 kB
require 'spec_helper.rb'
describe Paypal::Express, '.new' do
let(:required_params) do
{
:username => 'nov',
:password => 'password',
:signature => 'sig',
:return_url => 'http://example.com/success',
:cancel_url => 'http://example.com/cancel'
}
end
context 'when any required parameters are missing' do
it 'should raise AttrMissing exception' do
required_params.keys.each do |missing_key|
insufficient_attributes = required_params.reject do |key, value|
key == missing_key
end
lambda do
Paypal::Express.new insufficient_attributes
end.should raise_error Paypal::AttrMissing
end
end
end
context 'when all required parameters are given' do
it 'should succeed' do
lambda do
Paypal::Express.new required_params
end.should_not raise_error Paypal::AttrMissing
end
end
end
Jump to Line
Something went wrong with that request. Please try again.