mirror of
https://github.com/discourse/discourse.git
synced 2026-08-13 06:25:11 -05:00
remove trailing whitespaces ❤️
This commit is contained in:
@@ -9,15 +9,15 @@ describe Oneboxer::AmazonOnebox do
|
||||
@o = Oneboxer::AmazonOnebox.new("http://www.amazon.com/Ruby-Programming-Language-David-Flanagan/dp/0596516177")
|
||||
FakeWeb.register_uri(:get, @o.translate_url, :response => fixture_file('oneboxer/amazon.response'))
|
||||
end
|
||||
|
||||
|
||||
it "translates the URL" do
|
||||
@o.translate_url.should == "http://www.amazon.com/gp/aw/d/0596516177"
|
||||
end
|
||||
|
||||
|
||||
it "generates the expected onebox for Amazon" do
|
||||
@o.onebox.should == expected_amazon_result
|
||||
end
|
||||
|
||||
|
||||
private
|
||||
def expected_amazon_result
|
||||
<<EXPECTED
|
||||
@@ -41,4 +41,4 @@ The Ruby Programming Language is the authoritative guide to Ruby ...
|
||||
</div>
|
||||
EXPECTED
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,16 +4,16 @@ require 'spec_helper'
|
||||
require 'oneboxer'
|
||||
require 'oneboxer/android_app_store_onebox'
|
||||
|
||||
describe Oneboxer::AndroidAppStoreOnebox do
|
||||
describe Oneboxer::AndroidAppStoreOnebox do
|
||||
before(:each) do
|
||||
@o = Oneboxer::AndroidAppStoreOnebox.new("https://play.google.com/store/apps/details?id=com.moosoft.parrot")
|
||||
FakeWeb.register_uri(:get, @o.translate_url, :response => fixture_file('oneboxer/android.response'))
|
||||
end
|
||||
|
||||
|
||||
it "generates the expected onebox for Android App Store" do
|
||||
@o.onebox.should == expected_android_app_store_result
|
||||
end
|
||||
|
||||
|
||||
private
|
||||
def expected_android_app_store_result
|
||||
<<EXPECTED
|
||||
@@ -38,4 +38,4 @@ private
|
||||
</div>
|
||||
EXPECTED
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -9,11 +9,11 @@ describe Oneboxer::AppleAppOnebox do
|
||||
@o = Oneboxer::AppleAppOnebox.new("https://itunes.apple.com/us/app/minecraft-pocket-edition-lite/id479651754")
|
||||
FakeWeb.register_uri(:get, @o.translate_url, :response => fixture_file('oneboxer/apple.response'))
|
||||
end
|
||||
|
||||
|
||||
it "generates the expected onebox for Apple app" do
|
||||
@o.onebox.should == expected_apple_app_result
|
||||
end
|
||||
|
||||
|
||||
private
|
||||
def expected_apple_app_result
|
||||
<<EXPECTED
|
||||
@@ -35,4 +35,4 @@ private
|
||||
</div>
|
||||
EXPECTED
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,18 +4,18 @@ require 'spec_helper'
|
||||
require 'oneboxer'
|
||||
require 'oneboxer/flickr_onebox'
|
||||
|
||||
describe Oneboxer::FlickrOnebox do
|
||||
describe Oneboxer::FlickrOnebox do
|
||||
before(:each) do
|
||||
@o = Oneboxer::FlickrOnebox.new("http://www.flickr.com/photos/jaimeiniesta/3303881265")
|
||||
FakeWeb.register_uri(:get, @o.translate_url, :response => fixture_file('oneboxer/flickr.response'))
|
||||
end
|
||||
|
||||
|
||||
it "generates the expected onebox for Flickr" do
|
||||
@o.onebox.should == expected_flickr_result
|
||||
end
|
||||
|
||||
|
||||
private
|
||||
def expected_flickr_result
|
||||
"<a href='http://www.flickr.com/photos/jaimeiniesta/3303881265' target='_blank'><img src='http://farm4.staticflickr.com/3419/3303881265_c6924748e8_z.jpg' alt=''></a>"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2,8 +2,8 @@ require 'spec_helper'
|
||||
require 'oneboxer'
|
||||
require 'oneboxer/gist_onebox'
|
||||
|
||||
describe Oneboxer::GistOnebox do
|
||||
it "does not trip on user names" do
|
||||
describe Oneboxer::GistOnebox do
|
||||
it "does not trip on user names" do
|
||||
o = Oneboxer::GistOnebox.new('https://gist.github.com/aaa/4599619')
|
||||
o.translate_url.should == 'https://api.github.com/gists/4599619'
|
||||
end
|
||||
|
||||
@@ -10,11 +10,11 @@ describe Oneboxer::WikipediaOnebox do
|
||||
FakeWeb.register_uri(:get, @o.translate_url, :response => fixture_file('oneboxer/wikipedia.response'))
|
||||
FakeWeb.register_uri(:get, 'http://en.m.wikipedia.org/wiki/Ruby', :response => fixture_file('oneboxer/wikipedia_redirected.response'))
|
||||
end
|
||||
|
||||
|
||||
it "generates the expected onebox for Wikipedia" do
|
||||
@o.onebox.should == expected_wikipedia_result
|
||||
end
|
||||
|
||||
|
||||
private
|
||||
def expected_wikipedia_result
|
||||
<<EXPECTED
|
||||
@@ -36,4 +36,4 @@ private
|
||||
</div>
|
||||
EXPECTED
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user