Sha256: 857080fb9a205e462c53bd2f948f8f83e1d1d66abfc955a98b20f4f3b61796f8

Contents?: true

Size: 689 Bytes

Versions: 1

Compression:

Stored size: 689 Bytes

Contents

require 'spec_helper'

describe Jackpot::Gateway do 

  let(:gateway_component) { ActiveMerchant::Billing::BogusGateway.new } 
  subject                 { Jackpot::Gateway.new(gateway_component) } 

  it "checks if the gateway component has a method" do
    gateway_component.should_receive(:respond_to?).with('purchase')
    subject.respond_to? 'purchase'
  end 

  it "should not recognize methods this component doesn't respond to" do
    expect { subject.foo }.to raise_error(NoMethodError)
  end 

  it "forwards every call the component knows to gateway component" do
    gateway_component.should_receive(:purchase).with(1000, 'args')
    subject.purchase(1000, 'args')
  end 

end 

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jackpot-0.0.3 spec/models/jackpot/gateway_spec.rb