<commit_before>require 'spec_helper'

describe Judopay do
	it "should pass" do
    #payment = FactoryGirl.build(:payment)
		expect(true).to eq(true)
	end
end

describe Judopay::Transaction do

  it "should list all transactions" do
    # Judopay.configure do |config|
    #   config.api_token = ENV['JUDO_TOKEN']
    #   config.api_secret = ENV['JUDO_SECRET']
    # end

    # expect(Judopay::Transaction.all).to be_a(Hash)
  end
end

describe Faraday::Response do

  Judopay.configure do |config|
  end<commit_msg>Added test for Transaction.list with Webmock stub<commit_after>require 'spec_helper'

describe Judopay do
	it "should pass" do
    #payment = FactoryGirl.build(:payment)
		expect(true).to eq(true)
	end
end

describe Judopay::Transaction do

  it "should list all transactions" do
    stub_get('/transactions').
      to_return(:status => 200,
                :body => lambda { |request| JSON.generate({'results' => [{'amount' => 1.01}]}) })

    Judopay.configure

    transactions = Judopay::Transaction.all
    expect(transactions).to be_a(Hash)
    expect(transactions.results[0].amount).to equal(1.01)
  end
end

describe Faraday::Response do

  Judopay.configure
{'fraction_non_alphanumeric': 0.116751269035533, 'fraction_numerical': 0.008460236886632826, 'mean_word_length': 3.8884297520661155, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, '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': '4186351', 'n_tokens_mistral': 412, 'n_tokens_neox': 388, 'n_words': 94}