This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

alias TransactionDetail#related_transactions, for grammar

  • Loading branch information...
cainlevy committed Mar 2, 2012
1 parent c8e5020 commit b9de14e3625a37d582bce088ed33bbb3c044c21e
Showing with 14 additions and 0 deletions.
  1. +2 −0 lib/amazon_flex_pay/data_types.rb
  2. +12 −0 test/data_types_test.rb
@@ -125,6 +125,8 @@ class TransactionDetail < AmazonFlexPay::Model #:nodoc:
attribute :transaction_amount, :type => :amount
attribute :transaction_id
attribute :transaction_status, :enumeration => :transaction_status
+
+ alias_method :related_transactions, :related_transaction
end
class TransactionPart < AmazonFlexPay::Model #:nodoc:
View
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/test_helper'
+
+class AmazonFlexPayTest < AmazonFlexPay::Test
+ include AmazonFlexPay::DataTypes
+ include ResponseSamples
+
+ should "alias TransactionDetail#related_transaction" do
+ detail = TransactionDetail.new(:related_transaction => [{:relation_type => 'Refund', :transaction_id => 'abc123'}])
+ assert detail.respond_to?(:related_transactions)
+ assert_equal detail.related_transactions, detail.related_transaction
+ end
+end

0 comments on commit b9de14e

Please sign in to comment.