<commit_before>require "spec_helper"

describe Onebox::Engine::TwitterOnebox do
  before(:all) do
    @link = "https://twitter.com/toastergrrl/status/363116819147538433"
    fake(@link, response(described_class.template_name))
  end
  before(:each) { Onebox.defaults.cache.clear }

  let(:link) { @link }

  it_behaves_like "an engine"

  describe "#to_html" do
    let(:html) { described_class.new(link).to_html }

    it "has tweet id" do
      expect(html).to include("363116819147538433")
    end

    it "has tweet text" do
      expect(html).to include("I\'m a sucker for pledges.")
    end

    it "has tweet time and date" do
      expect(html).to include("6:59 PM - 1 Aug 13")
    end

    it "has user name" do
      expect(html).to include("@toastergrrl")
    end

    it "has user avatar" do
      expect(html).to include("39b969d32a10b2437563e246708c8f9d_normal.jpeg")
    end

    it "has tweet favorite count" do
      pending
      expect(html).to include("")
    end

    it "has retweet count" do
      pending
      expect(html).to include("")
    end

    it "has URL" do
      expect(html).to include(link)
    end
  end
end
<commit_msg>update test since no longer using json for twitter onebox #82<commit_after>require "spec_helper"

describe Onebox::Engine::TwitterOnebox do
  before(:all) do
    @link = "https://twitter.com/toastergrrl/status/363116819147538433"
    fake(@link, response(described_class.template_name))
  end
  before(:each) { Onebox.defaults.cache.clear }

  let(:link) { @link }

  it_behaves_like "an engine"

  describe "#to_html" do
    let(:html) { described_class.new(link).to_html }

    it "has tweet text" do
      expect(html).to include("I\'m a sucker for pledges.")
    end

    it "has tweet time and date" do
      expect(html).to include("6:59 PM - 1 Aug 13")
    end

    it "has user name" do
      expect(html).to include("@toastergrrl")
    end

    it "has user avatar" do
      expect(html).to include("39b969d32a10b2437563e246708c8f9d_normal.jpeg")
    end

    it "has tweet favorite count" do
      pending
      expect(html).to include("")
    end

    it "has retweet count" do
      pending
      expect(html).to include("")
    end

    it "has URL" do
      expect(html).to include(link)
    end
  end
end

{'fraction_non_alphanumeric': 0.11501316944688324, 'fraction_numerical': 0.050921861281826165, 'mean_word_length': 2.936096718480138, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4432072', 'n_tokens_mistral': 871, 'n_tokens_neox': 761, 'n_words': 206}