Sha256: b5ea5addf0a5284ca11bc277f2e8940ddb2309871cea1d93f3eb8b153e57dd95

Contents?: true

Size: 1.13 KB

Versions: 5

Compression:

Stored size: 1.13 KB

Contents

require 'spec_helper'

describe Killbill::PaypalExpress::PaymentPlugin do

  include ::Killbill::Plugin::ActiveMerchant::RSpec

  before(:each) do
    Dir.mktmpdir do |dir|
      file = File.new(File.join(dir, 'paypal_express.yml'), 'w+')
      file.write(<<-eos)
:paypal_express:
  :signature: 'signature'
  :login: 'login'
  :password: 'password'
  :test: true
# As defined by spec_helper.rb
:database:
  :adapter: 'sqlite3'
  :database: 'test.db'
      eos
      file.close

      @plugin = build_plugin(::Killbill::PaypalExpress::PaymentPlugin, 'paypal_express', File.dirname(file))

      # Start the plugin here - since the config file will be deleted
      @plugin.start_plugin
    end
  end

  it 'should start and stop correctly' do
    @plugin.stop_plugin
  end

  it 'should receive notifications correctly' do
    description    = 'description'

    kb_tenant_id = SecureRandom.uuid
    context      = @plugin.kb_apis.create_context(kb_tenant_id)
    properties   = @plugin.hash_to_properties({ :description => description })

    notification    = ''
    gw_notification = @plugin.process_notification notification, properties, context
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
killbill-paypal-express-4.1.4 spec/paypal_express/base_plugin_spec.rb
killbill-paypal-express-4.1.3 spec/paypal_express/base_plugin_spec.rb
killbill-paypal-express-4.1.2 spec/paypal_express/base_plugin_spec.rb
killbill-paypal-express-4.1.1 spec/paypal_express/base_plugin_spec.rb
killbill-paypal-express-4.1.0 spec/paypal_express/base_plugin_spec.rb