Sha256: ca4d66132c978f2e3a007992fb4a89191e8f370cb3177a90de42ef0d413fd689

Contents?: true

Size: 1.02 KB

Versions: 1

Compression:

Stored size: 1.02 KB

Contents

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
onebox-1.1.0 spec/lib/onebox/engine/twitter_onebox_spec.rb