Sha256: da0457cdbe1e9dafb0e324eef10e14217e53ae315a764192a118c0ae3f46e2b8

Contents?: true

Size: 761 Bytes

Versions: 35

Compression:

Stored size: 761 Bytes

Contents

require "spec_helper"

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
    fake(api_link, 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

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
onebox-1.8.39 spec/lib/onebox/engine/wikimedia_onebox_spec.rb
onebox-1.8.38 spec/lib/onebox/engine/wikimedia_onebox_spec.rb
onebox-1.8.36 spec/lib/onebox/engine/wikimedia_onebox_spec.rb
onebox-1.8.35 spec/lib/onebox/engine/wikimedia_onebox_spec.rb
onebox-1.8.34 spec/lib/onebox/engine/wikimedia_onebox_spec.rb
onebox-1.8.33 spec/lib/onebox/engine/wikimedia_onebox_spec.rb
onebox-1.8.32 spec/lib/onebox/engine/wikimedia_onebox_spec.rb
onebox-1.8.31 spec/lib/onebox/engine/wikimedia_onebox_spec.rb
onebox-1.8.30 spec/lib/onebox/engine/wikimedia_onebox_spec.rb
onebox-1.8.29 spec/lib/onebox/engine/wikimedia_onebox_spec.rb
onebox-1.8.28 spec/lib/onebox/engine/wikimedia_onebox_spec.rb
onebox-1.8.27 spec/lib/onebox/engine/wikimedia_onebox_spec.rb
onebox-1.8.26 spec/lib/onebox/engine/wikimedia_onebox_spec.rb
onebox-1.8.25 spec/lib/onebox/engine/wikimedia_onebox_spec.rb
onebox-1.8.24 spec/lib/onebox/engine/wikimedia_onebox_spec.rb
onebox-1.8.23 spec/lib/onebox/engine/wikimedia_onebox_spec.rb
onebox-1.8.22 spec/lib/onebox/engine/wikimedia_onebox_spec.rb
onebox-1.8.21 spec/lib/onebox/engine/wikimedia_onebox_spec.rb
onebox-1.8.20 spec/lib/onebox/engine/wikimedia_onebox_spec.rb
onebox-1.8.19 spec/lib/onebox/engine/wikimedia_onebox_spec.rb