<commit_before>require 'spec_helper'

describe SynapseClient::MassPay do

  before(:each) do
    @customer_a     = get_dummy_customer
    @bank_account_a = @customer_a.add_bank_account(dummy_add_bank_account_info)

    @customer_b     = get_dummy_customer
    @bank_account_b = @customer_b.add_bank_account(dummy_add_bank_account_info)
  end

=begin

  curl -H "Content-Type: application/json" -d '{  
    "oauth_consumer_key":"<KEY>",
    "mass_pays":[  
      {  
        "amount":"20",
        "trans_type":"0",
        "source_bank_id":"579",
        "dest_bank_id":"600"
      },
      {  
        "amount":"10",
        "trans_type":"0",
        "source_bank_id":"579",
        "dest_bank_id":"10"
      }
    ]
  }'
  https://sandbox.synapsepay.com/api/v2/masspay/add/

=end

  describe "adding a bunch of deposits to users" do
    it "should successfully return multiple mass pays" do

      params = { 
        :access_token => @customer_b.access_token,
        :mass_pays => [{
          :amount => 20.to_s,
          :trans_type => 0.to_s,
          :source_bank_id => @bank_account_a.id.to_s,
          :dest_bank_id => @bank_account_b.id.to_s
        },{
          :amount => 10.to_s,
          :trans_type => 0.to_s,
          :source_bank_id => @bank_account_a.id.to_s,
          :dest_bank_id => @bank_account_b.id.to_s
        }]
      }

      masspays = SynapseClient::MassPay.create(params)

      if !masspays.successful?
        puts "*** Error message: #{ masspays.error_msg }"
      end

      expect(masspays.successful?).to be true

      masspays.each do |mp|
        expect(mp.amount).to be_a Fixnum
        expect(mp.trans_type).to be_a Fixnum
        expect(mp.source_bank_id).to be_a Fixnum
        expect(mp.dest_bank_id).to be_a Fixnum

        expect(mp.amount).to eq(20).or eq(10)
        expect(mp.trans_type).to eq(0)
        expect(mp.source_bank_id).to eq(@bank_account_a.id)
        expect(mp.dest_bank_id).to eq(@bank_account_b.id)
      end

    end
  end

end


<commit_msg>remove comment example of request.<commit_after>require 'spec_helper'

describe SynapseClient::MassPay do

  before(:each) do
    @customer_a     = get_dummy_customer
    @bank_account_a = @customer_a.add_bank_account(dummy_add_bank_account_info)

    @customer_b     = get_dummy_customer
    @bank_account_b = @customer_b.add_bank_account(dummy_add_bank_account_info)
  end

  describe "adding a bunch of deposits to users" do
    it "should successfully return multiple mass pays" do

      params = { 
        :access_token => @customer_b.access_token,
        :mass_pays => [{
          :amount => 20.to_s,
          :trans_type => 0.to_s,
          :source_bank_id => @bank_account_a.id.to_s,
          :dest_bank_id => @bank_account_b.id.to_s
        },{
          :amount => 10.to_s,
          :trans_type => 0.to_s,
          :source_bank_id => @bank_account_a.id.to_s,
          :dest_bank_id => @bank_account_b.id.to_s
        }]
      }

      masspays = SynapseClient::MassPay.create(params)

      if !masspays.successful?
        puts "*** Error message: #{ masspays.error_msg }"
      end

      expect(masspays.successful?).to be true

      masspays.each do |mp|
        expect(mp.amount).to be_a Fixnum
        expect(mp.trans_type).to be_a Fixnum
        expect(mp.source_bank_id).to be_a Fixnum
        expect(mp.dest_bank_id).to be_a Fixnum

        expect(mp.amount).to eq(20).or eq(10)
        expect(mp.trans_type).to eq(0)
        expect(mp.source_bank_id).to eq(@bank_account_a.id)
        expect(mp.dest_bank_id).to eq(@bank_account_b.id)
      end

    end
  end

end



{'fraction_non_alphanumeric': 0.11784232365145228, 'fraction_numerical': 0.011065006915629323, 'mean_word_length': 2.4470924690181124, 'pattern_counts': {'":': 10, '<': 4, '<?xml version=': 0, '>': 24, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '654264', 'n_tokens_mistral': 1334, 'n_tokens_neox': 1276, 'n_words': 208}