mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 05:23:40 +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
24 lines
825 B
Ruby
24 lines
825 B
Ruby
# frozen_string_literal: true
|
|
|
|
RSpec.describe Onebox::Engine::WikimediaOnebox do
|
|
let(:link) { "https://commons.wikimedia.org/wiki/File:Stones_members_montage2.jpg" }
|
|
let(:api_link) { "https://en.wikipedia.org/w/api.php?action=query&titles=File:Stones_members_montage2.jpg&prop=imageinfo&iilimit=50&iiprop=timestamp|user|url&iiurlwidth=500&format=json" }
|
|
let(:html) { described_class.new(link).to_html }
|
|
|
|
before do
|
|
stub_request(:get, api_link).to_return(status: 200, body: onebox_response("wikimedia"))
|
|
end
|
|
|
|
it "has the title" do
|
|
expect(html).to include("File:Stones members montage2.jpg")
|
|
end
|
|
|
|
it "has the link" do
|
|
expect(html).to include(link)
|
|
end
|
|
|
|
it "has the image" do
|
|
expect(html).to include("https://upload.wikimedia.org/wikipedia/commons/a/af/Stones_members_montage2.jpg")
|
|
end
|
|
end
|