spec/lib/onebox/engine/image_onebox_spec.rb in onebox-1.5.17 vs spec/lib/onebox/engine/image_onebox_spec.rb in onebox-1.5.18
- old
+ new
@@ -1,39 +1,39 @@
require "spec_helper"
describe Onebox::Engine::ImageOnebox do
it "supports png" do
- Onebox.preview('http://www.discourse.org/images/logo.png').to_s.should match(/<img/)
+ expect(Onebox.preview('http://www.discourse.org/images/logo.png').to_s).to match(/<img/)
end
it "supports jpg" do
- Onebox.preview('http://upload.wikimedia.org/wikipedia/en/a/a9/Example.jpg').to_s.should match(/<img/)
+ expect(Onebox.preview('http://upload.wikimedia.org/wikipedia/en/a/a9/Example.jpg').to_s).to match(/<img/)
end
it "supports jpeg" do
- Onebox.preview('http://upload.wikimedia.org/wikipedia/en/b/bb/Poster.jpeg').to_s.should match(/<img/)
+ expect(Onebox.preview('http://upload.wikimedia.org/wikipedia/en/b/bb/Poster.jpeg').to_s).to match(/<img/)
end
it "supports gif" do
- Onebox.preview('http://upload.wikimedia.org/wikipedia/commons/5/55/Tesseract.gif').to_s.should match(/<img/)
+ expect(Onebox.preview('http://upload.wikimedia.org/wikipedia/commons/5/55/Tesseract.gif').to_s).to match(/<img/)
end
it "supports tif" do
- Onebox.preview('http://www.fileformat.info/format/tiff/sample/1f37bbd5603048178487ec88b1a6425b/MARBLES.tif').to_s.should match(/<img/)
+ expect(Onebox.preview('http://www.fileformat.info/format/tiff/sample/1f37bbd5603048178487ec88b1a6425b/MARBLES.tif').to_s).to match(/<img/)
end
it "supports bmp" do
- Onebox.preview('http://www.fileformat.info/format/bmp/sample/d4202a5fc22a48c388d9e1c636792cc6/LAND.BMP').to_s.should match(/<img/)
+ expect(Onebox.preview('http://www.fileformat.info/format/bmp/sample/d4202a5fc22a48c388d9e1c636792cc6/LAND.BMP').to_s).to match(/<img/)
end
it "supports image URLs with query parameters" do
- Onebox.preview('https://www.google.com/logos/doodles/2014/percy-julians-115th-birthday-born-1899-5688801926053888-hp.jpg?foo=bar').to_s.should match(/<img/)
+ expect(Onebox.preview('https://www.google.com/logos/doodles/2014/percy-julians-115th-birthday-born-1899-5688801926053888-hp.jpg?foo=bar').to_s).to match(/<img/)
end
it "supports protocol relative image URLs" do
- Onebox.preview('//www.google.com/logos/doodles/2014/percy-julians-115th-birthday-born-1899-5688801926053888-hp.jpg').to_s.should match(/<img/)
+ expect(Onebox.preview('//www.google.com/logos/doodles/2014/percy-julians-115th-birthday-born-1899-5688801926053888-hp.jpg').to_s).to match(/<img/)
end
it "includes a direct link to the image" do
- Onebox.preview('http://www.discourse.org/images/logo.png').to_s.should match(/<a.*png/)
+ expect(Onebox.preview('http://www.discourse.org/images/logo.png').to_s).to match(/<a.*png/)
end
end