@@ -5769,6 +5769,51 @@ describe('Opponents', function() {
57695769
57705770require . register ( "test/paymentNotes" , function ( exports , require , module ) {
57715771describe ( 'Payment Notes' , function ( ) {
5772+ var member , memberPayment , paymentNote , teamFee ;
5773+ teamFee = null ;
5774+ member = null ;
5775+ memberPayment = null ;
5776+ paymentNote = null ;
5777+ before ( function ( done ) {
5778+ teamFee = teamsnap . createTeamFee ( ) ;
5779+ teamFee . teamId = team . id ;
5780+ teamFee . description = 'Test Team Fee' ;
5781+ teamFee . amount = 1 ;
5782+ return teamsnap . saveTeamFee ( teamFee , function ( err , result ) {
5783+ expect ( err ) . to . be [ "null" ] ;
5784+ return done ( ) ;
5785+ } ) ;
5786+ } ) ;
5787+ before ( function ( done ) {
5788+ member = teamsnap . createMember ( ) ;
5789+ member . teamId = team . id ;
5790+ member . firstName = 'Test' ;
5791+ return teamsnap . saveMember ( member , function ( err , result ) {
5792+ expect ( err ) . to . be [ "null" ] ;
5793+ return done ( ) ;
5794+ } ) ;
5795+ } ) ;
5796+ before ( function ( done ) {
5797+ return teamsnap . loadMemberPayments ( {
5798+ memberId : member . id ,
5799+ teamFeeId : teamFee . id
5800+ } ) . then ( function ( memberPayments ) {
5801+ memberPayment = memberPayments [ 0 ] ;
5802+ return done ( ) ;
5803+ } ) ;
5804+ } ) ;
5805+ after ( function ( done ) {
5806+ return teamsnap . deleteMember ( member , function ( err , result ) {
5807+ expect ( err ) . to . be [ "null" ] ;
5808+ return done ( ) ;
5809+ } ) ;
5810+ } ) ;
5811+ after ( function ( done ) {
5812+ return teamsnap . deleteTeamFee ( teamFee , function ( err , result ) {
5813+ expect ( err ) . to . be [ "null" ] ;
5814+ return done ( ) ;
5815+ } ) ;
5816+ } ) ;
57725817 it ( 'should be able to load all payment notes for a team' , function ( done ) {
57735818 return teamsnap . loadPaymentNotes ( team . id , function ( err , result ) {
57745819 expect ( err ) . to . be [ "null" ] ;
@@ -5777,10 +5822,9 @@ describe('Payment Notes', function() {
57775822 } ) ;
57785823 } ) ;
57795824 return it ( 'should be able to create a payment note' , function ( done ) {
5780- var paymentNote ;
57815825 paymentNote = teamsnap . createPaymentNote ( ) ;
57825826 paymentNote . teamId = team . id ;
5783- paymentNote . memberPaymentId = 1 ;
5827+ paymentNote . memberPaymentId = memberPayment . id ;
57845828 paymentNote . note = 'Test payment note.' ;
57855829 paymentNote . description = 'Payment Note Description' ;
57865830 return teamsnap . savePaymentNote ( paymentNote , function ( err , result ) {
@@ -5869,15 +5913,16 @@ describe('Sports', function() {
58695913
58705914require . register ( "test/teamFees" , function ( exports , require , module ) {
58715915describe ( 'Team Fees' , function ( ) {
5916+ var teamFee ;
5917+ teamFee = null ;
58725918 it ( 'should be able to load all team fees' , function ( done ) {
58735919 return teamsnap . loadTeamFees ( team . id , function ( err , result ) {
58745920 expect ( err ) . to . be [ "null" ] ;
58755921 result . should . be . an ( 'array' ) ;
58765922 return done ( ) ;
58775923 } ) ;
58785924 } ) ;
5879- return it ( 'should be able to create a team fee' , function ( done ) {
5880- var teamFee ;
5925+ it ( 'should be able to create a team fee' , function ( done ) {
58815926 teamFee = teamsnap . createTeamFee ( ) ;
58825927 teamFee . teamId = team . id ;
58835928 teamFee . description = 'Test Team Fee' ;
@@ -5888,6 +5933,12 @@ describe('Team Fees', function() {
58885933 return done ( ) ;
58895934 } ) ;
58905935 } ) ;
5936+ return it ( 'should be able to delete a team fee' , function ( done ) {
5937+ return teamsnap . deleteTeamFee ( teamFee , function ( err , result ) {
5938+ expect ( err ) . to . be [ "null" ] ;
5939+ return done ( ) ;
5940+ } ) ;
5941+ } ) ;
58915942} ) ;
58925943
58935944} ) ;
0 commit comments