spec/integration/braintree/document_upload_spec.rb in braintree-2.93.0 vs spec/integration/braintree/document_upload_spec.rb in braintree-2.94.0
- old
+ new
@@ -44,9 +44,16 @@
ensure
File.delete(filename)
end
end
+ it "returns file too long error with file over 50 pages" do
+ filename = "#{File.dirname(__FILE__)}/../../fixtures/files/too_long.pdf"
+ file = File.new(filename, "r")
+ response = Braintree::DocumentUpload.create({:kind => Braintree::DocumentUpload::Kind::EvidenceDocument, :file => file})
+ response.errors.for(:document_upload).first.code.should == Braintree::ErrorCodes::DocumentUpload::FileIsTooLong
+ end
+
it "returns invalid keys error if signature is invalid" do
expect do
response = Braintree::DocumentUpload.create({:invalid_key => "do not add", :kind => Braintree::DocumentUpload::Kind::EvidenceDocument})
end.to raise_error(ArgumentError, "invalid keys: invalid_key")
end