Sha256: ced03ec0be316b1d74a2dc933c51ac51261226d6cc8184e3540b548d88c94154

Contents?: true

Size: 755 Bytes

Versions: 3

Compression:

Stored size: 755 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe Cardflex::Plan do
  it 'should create plan' do
    # have to give a plan id unique to the test account. Since this account is shared by all testers of the api,
    # it's possible that this will conflict. so we'll accept a conflicting plan-id as a success.
    plan_id = ('a'..'z').to_a.shuffle.take(10).join
    req = { :plan => {
        :payments => 0,
        :amount => 1.5,
        :name => 'test_plan',
        :plan_id => plan_id,
        :day_frequency => 30
      }
    }

    res = Cardflex::Plan.create(req)
    if defined? res.result_code
      expect(res.result_code.to_i).to eq 300
    else
      expect(res.plan.plan[:plan_id]).to eq plan_id
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cardflex-ruby-0.1.2 spec/integration/cardflex/plan_spec.rb
cardflex-ruby-0.1.1 spec/integration/cardflex/plan_spec.rb
cardflex-ruby-0.0.1 spec/integration/cardflex/plan_spec.rb