Sha256: 6bc448d2be40fd9b7aefe301cc81381429e354fa155dadd95d351c2472a6f5c6

Contents?: true

Size: 1.67 KB

Versions: 50

Compression:

Stored size: 1.67 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)
      document_upload.id.should == "my_id"
      document_upload.size.should == 555
      document_upload.name.should == "up_file.pdf"
      document_upload.content_type.should == "application/pdf"
      document_upload.kind.should == 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)
      document_upload.kind.should == 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)
      document_upload.kind.should == 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)
      document_upload.kind.should == Braintree::DocumentUpload::Kind::PayoutInvoiceDocument
    end
  end
end

Version data entries

50 entries across 50 versions & 1 rubygems

Version Path
braintree-4.14.0 spec/unit/braintree/document_upload_spec.rb
braintree-4.13.0 spec/unit/braintree/document_upload_spec.rb
braintree-4.12.0 spec/unit/braintree/document_upload_spec.rb
braintree-4.11.0 spec/unit/braintree/document_upload_spec.rb
braintree-4.10.0 spec/unit/braintree/document_upload_spec.rb
braintree-4.9.0 spec/unit/braintree/document_upload_spec.rb
braintree-4.8.0 spec/unit/braintree/document_upload_spec.rb
braintree-4.7.0 spec/unit/braintree/document_upload_spec.rb
braintree-4.6.0 spec/unit/braintree/document_upload_spec.rb
braintree-4.5.0 spec/unit/braintree/document_upload_spec.rb
braintree-4.4.0 spec/unit/braintree/document_upload_spec.rb
braintree-4.3.0 spec/unit/braintree/document_upload_spec.rb
braintree-4.2.0 spec/unit/braintree/document_upload_spec.rb
braintree-4.1.0 spec/unit/braintree/document_upload_spec.rb
braintree-4.0.0 spec/unit/braintree/document_upload_spec.rb
braintree-3.4.0 spec/unit/braintree/document_upload_spec.rb
braintree-3.3.0 spec/unit/braintree/document_upload_spec.rb
braintree-3.2.0 spec/unit/braintree/document_upload_spec.rb
braintree-3.1.0 spec/unit/braintree/document_upload_spec.rb
braintree-3.0.1 spec/unit/braintree/document_upload_spec.rb