Sha256: eb72bb0aa7d559acaf9bb2445a2d635ea8d8ae7badc4abb676313ef368270816

Contents?: true

Size: 1.38 KB

Versions: 7

Compression:

Stored size: 1.38 KB

Contents

# -*- encoding : utf-8 -*-
require 'spec_helper'

describe Rubykassa::PaymentInterface do
  before(:each) do
    @payment_interface = Rubykassa::PaymentInterface.new do
      self.invoice_id = 12
      self.total = 1200
      self.params = { foo: "bar" }
    end

    Rubykassa.configure do |config|
    end
  end

  it "should return correct base_url" do
    @payment_interface.base_url.should == "http://test.robokassa.ru/Index.aspx"
  end

  it "should return correct pay_url" do
    @payment_interface.pay_url.should == "http://test.robokassa.ru/Index.aspx?MrchLogin=your_login&OutSum=1200&InvId=12&SignatureValue=bf0504363d89638669e057932857316c&shpfoo=bar"
  end

  it "should return correct pay_url when additional options passed" do
    @payment_interface.pay_url({description: "desc", culture: "ru", email: "foo@bar.com", currency: ""}).should == "http://test.robokassa.ru/Index.aspx?MrchLogin=your_login&OutSum=1200&InvId=12&SignatureValue=bf0504363d89638669e057932857316c&shpfoo=bar&IncCurrLabel=&Desc=desc&Email=foo@bar.com&Culture=ru"
  end

  it "should return correct initial_options" do
    @payment_interface.initial_options.should == {
      login: "your_login",
      total: 1200,
      invoice_id: 12,
      signature: "bf0504363d89638669e057932857316c",
      shpfoo: "bar"
    }
  end

  it "should return correct test_mode?" do
    @payment_interface.test_mode?.should == true
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rubykassa-0.4.2 spec/rubykassa/payment_interface_spec.rb
rubykassa-0.4.1 spec/rubykassa/payment_interface_spec.rb
rubykassa-0.4.0 spec/rubykassa/payment_interface_spec.rb
rubykassa-0.3.2 spec/rubykassa/payment_interface_spec.rb
rubykassa-0.3.1 spec/rubykassa/payment_interface_spec.rb
rubykassa-0.3.0 spec/rubykassa/payment_interface_spec.rb
rubykassa-0.2.6 spec/rubykassa/payment_interface_spec.rb