<commit_before>require 'spec_helper'

describe Docusign::DocumentHelper do

  before(:each) do
    WebMock.allow_net_connect!
  end

  after(:each) do
    WebMock.disable_net_connect!
  end
  
  let(:envelope) do
    begin
      Docusign::Envelope.create!(email_subject: Faker::Name.title, status: :sent) do |e|
        e.add_document(file_fixture('pdf1.pdf').expand_path)
        e.add_signer(name: Faker::Name.name, email: '<EMAIL>')
      end
    rescue => e
      puts e.to_yaml
    end
  end

  it 'can create embedded document markup' do
    w = [*1000..3000].sample
    h = [*1000..3000].sample
    iframe = embedded_document(envelope, width: w, height: h)
    expect(iframe).to include("<iframe width=\"#{w}\" height=\"#{h}\"")
    expect(iframe).to include('https://demo.docusign.net/Signing/startinsession.aspx')
  end<commit_msg>[CHG] Debugging travis build<commit_after>require 'spec_helper'

describe Docusign::DocumentHelper do

  before(:each) do
    WebMock.allow_net_connect!
  end

  after(:each) do
    WebMock.disable_net_connect!
  end
  
  let(:envelope) do
    begin
      Docusign::Envelope.create!(email_subject: Faker::Name.title, status: :sent) do |e|
        e.add_document(file_fixture('pdf1.pdf').expand_path)
        e.add_signer(name: Faker::Name.name, email: '<EMAIL>')
      end
    rescue => e
      puts e.backtrace
    end
  end

  it 'can create embedded document markup' do
    w = [*1000..3000].sample
    h = [*1000..3000].sample
    iframe = embedded_document(envelope, width: w, height: h)
    expect(iframe).to include("<iframe width=\"#{w}\" height=\"#{h}\"")
    expect(iframe).to include('https://demo.docusign.net/Signing/startinsession.aspx')
  end
{'fraction_non_alphanumeric': 0.14496169711255155, 'fraction_numerical': 0.020035356511490868, 'mean_word_length': 3.492063492063492, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '393184', 'n_tokens_mistral': 624, 'n_tokens_neox': 580, 'n_words': 118}