Sha256: de10c2671e226ad2964c5cf089554b604d72c9e4e0236d0d9a0e5b488b4b058a

Contents?: true

Size: 1.71 KB

Versions: 9

Compression:

Stored size: 1.71 KB

Contents

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

describe Braintree::DocumentUpload do
  describe "initialize" do
    it "sets attributes" do
      response = {:size => 555, :kind => "evidence_document", :name => "up_file.pdf", :content_type => "application/pdf", :id => "my_id"}
      document_upload = Braintree::DocumentUpload._new(response)
      expect(document_upload.id).to eq("my_id")
      expect(document_upload.size).to eq(555)
      expect(document_upload.name).to eq("up_file.pdf")
      expect(document_upload.content_type).to eq("application/pdf")
      expect(document_upload.kind).to eq(Braintree::DocumentUpload::Kind::EvidenceDocument)
    end
  end

  describe "kind" do
    it "sets identity document" do
      response = {:size => 555, :kind => "identity_document", :name => "up_file.pdf", :content_type => "application/pdf", :id => "my_id"}
      document_upload = Braintree::DocumentUpload._new(response)
      expect(document_upload.kind).to eq(Braintree::DocumentUpload::Kind::IdentityDocument)
    end

    it "sets evidence document" do
      response = {:size => 555, :kind => "evidence_document", :name => "up_file.pdf", :content_type => "application/pdf", :id => "my_id"}
      document_upload = Braintree::DocumentUpload._new(response)
      expect(document_upload.kind).to eq(Braintree::DocumentUpload::Kind::EvidenceDocument)
    end

    it "sets payout invoice document" do
      response = {:size => 555, :kind => "payout_invoice_document", :name => "up_file.pdf", :content_type => "application/pdf", :id => "my_id"}
      document_upload = Braintree::DocumentUpload._new(response)
      expect(document_upload.kind).to eq(Braintree::DocumentUpload::Kind::PayoutInvoiceDocument)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
braintree-4.23.0 spec/unit/braintree/document_upload_spec.rb
braintree-4.22.0 spec/unit/braintree/document_upload_spec.rb
braintree-4.21.0 spec/unit/braintree/document_upload_spec.rb
braintree-4.20.0 spec/unit/braintree/document_upload_spec.rb
braintree-4.19.0 spec/unit/braintree/document_upload_spec.rb
braintree-4.18.0 spec/unit/braintree/document_upload_spec.rb
braintree-4.17.0 spec/unit/braintree/document_upload_spec.rb
braintree-4.16.0 spec/unit/braintree/document_upload_spec.rb
braintree-4.15.0 spec/unit/braintree/document_upload_spec.rb