Sha256: 41f217e486dcd640e9bb0e1d0253bdaf2be5851d5acb251cf73e5b962985004a

Contents?: true

Size: 1.93 KB

Versions: 1

Compression:

Stored size: 1.93 KB

Contents

require 'spec_helper'

describe Buckaroo::Ideal::Config do
  before do
    Buckaroo::Ideal::Config.configure(
      :merchant_key    => 'merchant_key',
      :secret_key      => 'secret_key',
      :test_mode       => true,
      :success_url     => 'http://example.com/transaction/success',
      :reject_url      => 'http://example.com/transaction/reject',
      :error_url       => 'http://example.com/transaction/error',
      :return_method   => 'GET',
      :style           => 'POPUP',
      :autoclose_popup => true
    )
  end
  
  subject { Buckaroo::Ideal::Config }
  
  it 'has a gateway_url' do
    subject.gateway_url.should == 'https://payment.buckaroo.nl/gateway/ideal_payment.asp'
  end
  
  it 'has a merchant_key' do
    subject.merchant_key.should == 'merchant_key'
  end
  
  it 'has a secret_key' do
    subject.secret_key.should == 'secret_key'
  end
  
  it 'has a test_mode' do
    subject.test_mode.should be_true
  end
  
  it 'has a success_url' do
    subject.success_url.should == 'http://example.com/transaction/success'
  end
  
  it 'has a reject_url' do
    subject.reject_url.should == 'http://example.com/transaction/reject'
  end
  
  it 'has a error_url' do
    subject.error_url.should == 'http://example.com/transaction/error'
  end
  
  it 'has a return_method' do
    subject.return_method.should == 'GET'
  end
  
  it 'has a style' do
    subject.style.should == 'POPUP'
  end
  
  it 'has a autoclose_popup setting' do
    subject.autoclose_popup.should be_true
  end
  
  it 'can be reset to default values' do
    subject.reset
    subject.merchant_key.should    be_nil
    subject.secret_key.should      be_nil
    subject.test_mode.should       be_false
    subject.success_url.should     be_nil
    subject.reject_url.should      be_nil
    subject.error_url.should       be_nil
    subject.return_method.should   == 'POST'
    subject.style.should           == 'PAGE'
    subject.autoclose_popup.should be_false
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
buckaroo-ideal-0.0.2 spec/buckaroo-ideal/config_spec.rb