mirror of
https://github.com/discourse/discourse.git
synced 2024-12-02 06:54:15 +08:00
493d437e79
* Remove outdated option
04078317ba
* Use the non-globally exposed RSpec syntax
https://github.com/rspec/rspec-core/pull/2803
* Use the non-globally exposed RSpec syntax, cont
https://github.com/rspec/rspec-core/pull/2803
* Comply to strict predicate matchers
See:
- https://github.com/rspec/rspec-expectations/pull/1195
- https://github.com/rspec/rspec-expectations/pull/1196
- https://github.com/rspec/rspec-expectations/pull/1277
28 lines
725 B
Ruby
28 lines
725 B
Ruby
# frozen_string_literal: true
|
|
|
|
RSpec.describe Onebox::Engine::XkcdOnebox do
|
|
let(:link) { "https://xkcd.com/327/" }
|
|
let(:api_link) { "https://xkcd.com/327/info.0.json" }
|
|
let(:html) { described_class.new(link).to_html }
|
|
|
|
before do
|
|
stub_request(:get, api_link).to_return(status: 200, body: onebox_response("xkcd"))
|
|
end
|
|
|
|
it "has the comic's description" do
|
|
expect(html).to include("Her daughter is named Help")
|
|
end
|
|
|
|
it "has the comic's title" do
|
|
expect(html).to include("Exploits of a Mom")
|
|
end
|
|
|
|
it "has the permalink to the comic" do
|
|
expect(html).to include(link)
|
|
end
|
|
|
|
it "has the comic image" do
|
|
expect(html).to include("http://imgs.xkcd.com/comics/exploits_of_a_mom.png")
|
|
end
|
|
end
|