Sha256: 5496b61c4493ef5bc31a850256dd75881c2bb01d1efdd145c69ef29a07134f8c

Contents?: true

Size: 860 Bytes

Versions: 2

Compression:

Stored size: 860 Bytes

Contents

# -*- encoding: utf-8 -*-
require "helper"

describe CentrumFaktur::Invoice do
  before do
    CentrumFaktur.configure do |config|
      config.login     = "john"
      config.password  = "secret"
      config.subdomain = "john"
    end
  end

  it "detroys invoice" do
    FakeWeb.register_uri(:delete, "https://john:secret@john.centrumfaktur.pl/api/1.0/invoices/666/", :response => fixture("destroy_invoice.txt"))
    response = CentrumFaktur::Invoice.destroy("/api/1.0/invoices/666/")

    assert_equal nil, response
  end

  it "raises error when invoice does not exist" do
    FakeWeb.register_uri(:delete, "https://john:secret@john.centrumfaktur.pl/api/1.0/invoices/666/", :response => fixture("destroy_invoice_404.txt"))

    assert_raises CentrumFaktur::ResponseError do
      CentrumFaktur::Invoice.destroy("/api/1.0/invoices/666/")
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
centrum_faktur-0.2.2 test/invoice_test.rb
centrum_faktur-0.2.1 test/invoice_test.rb