Sha256: 66601571b370a348ddf0d44963cc58a38e8b31975c4b087eabd6b5ee803b83ed

Contents?: true

Size: 1.76 KB

Versions: 30

Compression:

Stored size: 1.76 KB

Contents

require "spec_helper"

describe Onebox::Engine::GoogleDocsOnebox do
  context "Spreadsheets" do
    let(:matcher) { described_class.new("https://docs.google.com/spreadsheets/d/SHEET_KEY/pubhtml") }

    it "should have spreadsheet class in html" do
      expect(matcher.to_html).to include "spreadsheet-onebox"
    end

    it "should be a spreadsheet" do
      expect(matcher.send(:spreadsheet?)).to be true
    end

    it "Should detect key" do
      expect(matcher.send(:key)).to eq 'SHEET_KEY'
    end
  end

  context "Documents" do
    let(:matcher) { described_class.new("https://docs.google.com/document/d/DOC_KEY/pub") }

    it "should have document class in html" do
      expect(matcher.to_html).to include "document-onebox"
    end

    it "should be a document" do
      expect(matcher.send(:document?)).to be true
    end

    it "Should detect key" do
      expect(matcher.send(:key)).to eq 'DOC_KEY'
    end
  end

  context "Presentaions" do
    let(:matcher) { described_class.new("https://docs.google.com/presentation/d/PRESENTATION_KEY/pub") }

    it "should have presentation class in html" do
      expect(matcher.to_html).to include "presentation-onebox"
    end

    it "should be a presentation" do
      expect(matcher.send(:presentation?)).to be true
    end

    it "Should detect key" do
      expect(matcher.send(:key)).to eq 'PRESENTATION_KEY'
    end
  end

  context "Forms" do
    let(:matcher) { described_class.new("https://docs.google.com/forms/d/FORMS_KEY/viewform") }

    it "should have forms class in html" do
      expect(matcher.to_html).to include "forms-onebox"
    end

    it "should be a form" do
      expect(matcher.send(:forms?)).to be true
    end

    it "Should detect key" do
      expect(matcher.send(:key)).to eq 'FORMS_KEY'
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
onebox-1.5.25 spec/lib/onebox/engine/google_docs_onebox_spec.rb
onebox-1.5.24 spec/lib/onebox/engine/google_docs_onebox_spec.rb
onebox-1.5.23 spec/lib/onebox/engine/google_docs_onebox_spec.rb
onebox-1.5.22 spec/lib/onebox/engine/google_docs_onebox_spec.rb
onebox-1.5.21 spec/lib/onebox/engine/google_docs_onebox_spec.rb
onebox-1.5.20 spec/lib/onebox/engine/google_docs_onebox_spec.rb
onebox-1.5.19 spec/lib/onebox/engine/google_docs_onebox_spec.rb
onebox-1.5.18 spec/lib/onebox/engine/google_docs_onebox_spec.rb
onebox-1.5.17 spec/lib/onebox/engine/google_docs_onebox_spec.rb
onebox-1.5.16 spec/lib/onebox/engine/google_docs_onebox_spec.rb