Sha256: 05cb3c5d87a3d83e1904af36efd91b29b157eac8ba0f5b682894a30628832762

Contents?: true

Size: 742 Bytes

Versions: 1

Compression:

Stored size: 742 Bytes

Contents

require "spec_helper"

describe Onebox::Preview do
  before(:each) { Onebox.defaults.cache.clear }

  describe "#to_s" do
    it "returns some html if given a valid url" do
      fake("http://www.example.com", response("example"))
      preview = described_class.new("http://www.example.com")
      expect(preview.to_s).to include("Example Domain 1")
    end
    it "returns an empty string if the resource is not found"
    it "returns an empty string if the resource fails to load"
    it "returns an empty string if the url is not valid"
  end

  describe "#engine" do
    it "returns an engine" do
      preview = described_class.new("http://www.example.com")
      expect(preview.send(:engine)).to be_a(Onebox::Engine)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
onebox-1.1.0 spec/lib/onebox/preview_spec.rb