Sha256: 74775457b14ee965f95074a693ef4d33ffe14fd502bf50615ebe0e71c98874f7

Contents?: true

Size: 975 Bytes

Versions: 11

Compression:

Stored size: 975 Bytes

Contents

require "slidepay"
require "spec_helper"

describe SlidePay::BankAccount do
  it "should have an id_attribute" do
    b = SlidePay::BankAccount.new()
    expect(b.id_attribute).to eq("bank_account_id")
  end

  it "should have a root url" do
    b = SlidePay::BankAccount.new()
    expect(b.url_root).to eq("bank_account")
  end

  describe "url" do
    it "should not append the object id if no id is set" do
      b = SlidePay::BankAccount.new()
      expect(b.url()).to eq("bank_account")
    end

    it "should append the object id if set" do
      b = SlidePay::BankAccount.new("bank_account_id" => 2)
      expect(b.url()).to eq("bank_account/2")
    end
  end

  describe "id" do
    it "should return nil if the id is not set" do
      b = SlidePay::BankAccount.new()
      expect(b.id()).to eq(nil)
    end

    it "should return the id if it is present" do
      b = SlidePay::BankAccount.new("bank_account_id" => 2)
      expect(b.id()).to eq(2)
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
slidepay-0.0.13 spec/bank_account_spec.rb
slidepay-0.0.12 spec/bank_account_spec.rb
slidepay-0.0.11 spec/bank_account_spec.rb
slidepay-0.0.10 spec/bank_account_spec.rb
slidepay-0.0.9 spec/bank_account_spec.rb
slidepay-0.0.8 spec/bank_account_spec.rb
slidepay-0.0.7 spec/bank_account_spec.rb
slidepay-0.0.6 spec/bank_account_spec.rb
slidepay-0.0.5 spec/bank_account_spec.rb
slidepay-0.0.4 spec/bank_account_spec.rb
slidepay-0.0.2 spec/bank_account_spec.rb