Sha256: 6a7bc8f0cfce8c36ea2cd78a6ebb770239dbb340783fde72a95592a454aa92a3

Contents?: true

Size: 910 Bytes

Versions: 11

Compression:

Stored size: 910 Bytes

Contents

require "slidepay"
require "spec_helper"

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

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

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

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

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

    it "should return the id if it is present" do
      b = SlidePay::ApiKey.new("api_key_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/api_key_spec.rb
slidepay-0.0.12 spec/api_key_spec.rb
slidepay-0.0.11 spec/api_key_spec.rb
slidepay-0.0.10 spec/api_key_spec.rb
slidepay-0.0.9 spec/api_key_spec.rb
slidepay-0.0.8 spec/api_key_spec.rb
slidepay-0.0.7 spec/api_key_spec.rb
slidepay-0.0.6 spec/api_key_spec.rb
slidepay-0.0.5 spec/api_key_spec.rb
slidepay-0.0.4 spec/api_key_spec.rb
slidepay-0.0.2 spec/api_key_spec.rb