mirror of
https://github.com/discourse/discourse.git
synced 2024-12-03 02:23:39 +08:00
c9dab6fd08
It's very easy to forget to add `require 'rails_helper'` at the top of every core/plugin spec file, and omissions can cause some very confusing/sporadic errors. By setting this flag in `.rspec`, we can remove the need for `require 'rails_helper'` entirely.
27 lines
654 B
Ruby
27 lines
654 B
Ruby
# frozen_string_literal: true
|
|
|
|
describe Onebox::Engine::GoogleDocsOnebox do
|
|
before do
|
|
@link = "https://docs.google.com/document/d/DOC_KEY/pub"
|
|
|
|
stub_request(:get, @link).to_return(status: 200, body: onebox_response("googledocs"))
|
|
end
|
|
|
|
include_context "engines"
|
|
it_behaves_like "an engine"
|
|
|
|
describe "#to_html" do
|
|
it "has title" do
|
|
expect(html).to include("Lorem Ipsum!")
|
|
end
|
|
|
|
it "has description" do
|
|
expect(html).to include("Lorem Ipsum Lorem ipsum dolor sit amet, consectetur adipiscing elit")
|
|
end
|
|
|
|
it "has icon" do
|
|
expect(html).to include("googledocs-onebox-logo g-docs-logo")
|
|
end
|
|
end
|
|
end
|