spec/integration/braintree/dispute_spec.rb in braintree-2.81.0 vs spec/integration/braintree/dispute_spec.rb in braintree-2.82.0

- old
+ new

@@ -97,10 +97,12 @@ result.evidence.comment.should == "text evidence" result.evidence.created_at.between?(Time.now - 10, Time.now).should == true result.evidence.id.should =~ /^\w{16,}$/ result.evidence.sent_to_processor_at.should == nil result.evidence.url.should == nil + result.evidence.tag.should == nil + result.evidence.sequence_number.should == nil end it "returns a NotFoundError if the dispute doesn't exist" do expect do Braintree::Dispute.add_text_evidence("unknown_dispute_id", "text evidence") @@ -121,9 +123,21 @@ refreshed_dispute = Braintree::Dispute.find(dispute.id) expected_evidence = refreshed_dispute.evidence.find { |e| e.id == result.evidence.id } expected_evidence.should_not == nil expected_evidence.comment.should == "text evidence" + end + + it "creates text evidence for the dispute with optional parameters" do + result = Braintree::Dispute.add_text_evidence(dispute.id, { content: "123456789", tag: "REFUND_ID", sequence_number: 7 }) + + result.success?.should == true + result.evidence.comment.should == "123456789" + result.evidence.created_at.between?(Time.now - 10, Time.now).should == true + result.evidence.id.should =~ /^\w{16,}$/ + result.evidence.sent_to_processor_at.should == nil + result.evidence.tag.should == "REFUND_ID" + result.evidence.sequence_number.should == 7 end end describe "self.finalize" do it "changes the dispute status to disputed" do