<commit_before>require "spec_helper"

describe Onebox::Engine::SmugMugOnebox do
  before(:all) do
    @link = "http://heyserphoto.smugmug.com/Feathers/Duck-feathers/18516485_5xM7Bj#!i=1179402985&k=kS5HMdV"
    fake(@link, response(described_class.template_name))
  end
  before(:each) { Onebox.defaults.cache.clear }

  let(:link) { @link }

  it_behaves_like "an engine"
<commit_msg>fix smugmug onebox spec to fake json api response instead of html #79<commit_after>require "spec_helper"

describe Onebox::Engine::SmugMugOnebox do
  before(:all) do
    @link = "http://heyserphoto.smugmug.com/Feathers/Duck-feathers/18516485_5xM7Bj#!i=1179402985&k=kS5HMdV"
    api = "https://api.smugmug.com/services/oembed/?url=http%3A%2F%2Fheyserphoto.smugmug.com%2FFeathers%2FDuck-feathers%2F18516485_5xM7Bj%23!i%3D1179402985%26k%3DkS5HMdV&format=json"
    fake(api, response(described_class.template_name))
  end
  before(:each) { Onebox.defaults.cache.clear }

  let(:link) { @link }

  it_behaves_like "an engine"

{'fraction_non_alphanumeric': 0.13432835820895522, 'fraction_numerical': 0.07661691542288557, 'mean_word_length': 5.986111111111111, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4617774', 'n_tokens_mistral': 467, 'n_tokens_neox': 424, 'n_words': 52}