-
- Listen to the parrot repeat what you say. A Fun application for all ages. Upgrade to Talking Parrot Pro to save sounds, set them as your ringtone and control recording.
- Press the MENU button to access the settings where you can change the record time and repeat count.
- This app uses anonymous usage stats to understand and improve performance.
- Comments and feedback welcome.
-
-
-
-EXPECTED
- end
-end
diff --git a/spec/components/oneboxer/apple_app_onebox_spec.rb b/spec/components/oneboxer/apple_app_onebox_spec.rb
deleted file mode 100644
index 20e67c2d5aa..00000000000
--- a/spec/components/oneboxer/apple_app_onebox_spec.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-# encoding: utf-8
-
-require 'spec_helper'
-require 'oneboxer'
-require 'oneboxer/apple_app_onebox'
-
-describe Oneboxer::AppleAppOnebox do
- before(:each) 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 match_html expected_apple_app_result
- end
-
-private
- def expected_apple_app_result
- <
-
-
- Imagine it, build it. Create worlds on the go with Minecraft - Pocket EditionThis is the Lite version of Minecraft - Pocket Edition. Minecraft - Pocket Edition allows you to build on the go. Use blocks to create masterpieces as you travel, hangout with friends, sit at the park, the possibilities are endless. Move beyond the limits of your computer and play Minecraft everywhere you go.Limitations of the Lite version* The world is not saved between sessions* Multiplayer worlds can not be copied to
-
-
-
-EXPECTED
- end
-end
diff --git a/spec/components/oneboxer/flash_video_onebox_spec.rb b/spec/components/oneboxer/flash_video_onebox_spec.rb
deleted file mode 100644
index 8f67ec24630..00000000000
--- a/spec/components/oneboxer/flash_video_onebox_spec.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-require 'spec_helper'
-require 'oneboxer'
-require 'oneboxer/_flash_video_onebox'
-
-describe Oneboxer::FlashVideoOnebox do
- before do
- @o = Oneboxer::FlashVideoOnebox.new('http://player.56.com/v_OTMyNTk1MzE.swf')
- end
-
- context "when SiteSetting.enable_flash_video_onebox is true" do
- before do
- SiteSetting.stubs(:enable_flash_video_onebox).returns(true)
- end
-
- it "generates a flash video" do
- expect(@o.onebox).to match_html(
- ""
- )
- end
- end
-
- context "when SiteSetting.enable_flash_video_onebox is false" do
- before do
- SiteSetting.stubs(:enable_flash_video_onebox).returns(false)
- end
-
- it "generates a link" do
- expect(@o.onebox).to match_html(
- "http://player.56.com/v_OTMyNTk1MzE.swf"
- )
- end
- end
-end
diff --git a/spec/components/oneboxer/flickr_onebox_spec.rb b/spec/components/oneboxer/flickr_onebox_spec.rb
deleted file mode 100644
index 51f80c02641..00000000000
--- a/spec/components/oneboxer/flickr_onebox_spec.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# encoding: utf-8
-
-require 'spec_helper'
-require 'oneboxer'
-require 'oneboxer/flickr_onebox'
-
-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 match_html expected_flickr_result
- end
-
-private
- def expected_flickr_result
- ""
- end
-end
diff --git a/spec/components/oneboxer/gist_onebox_spec.rb b/spec/components/oneboxer/gist_onebox_spec.rb
deleted file mode 100644
index 716716fec29..00000000000
--- a/spec/components/oneboxer/gist_onebox_spec.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-require 'spec_helper'
-require 'oneboxer'
-require 'oneboxer/gist_onebox'
-
-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
-
- it "works for old school urls too" do
- o = Oneboxer::GistOnebox.new('https://gist.github.com/4599619')
- o.translate_url.should == 'https://api.github.com/gists/4599619'
- end
-end
-
diff --git a/spec/components/oneboxer/github_commit_onebox_spec.rb b/spec/components/oneboxer/github_commit_onebox_spec.rb
deleted file mode 100644
index a1c075a873f..00000000000
--- a/spec/components/oneboxer/github_commit_onebox_spec.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# encoding: utf-8
-
-require 'spec_helper'
-require 'oneboxer'
-require 'oneboxer/github_commit_onebox'
-
-describe Oneboxer::GithubCommitOnebox do
- before(:each) do
- @o = Oneboxer::GithubCommitOnebox.new("https://github.com/discourse/discourse/commit/ee76f1926defa8309b3a7ea64a25707519529a13")
- FakeWeb.register_uri(:get, @o.translate_url, response: fixture_file('oneboxer/github_commit_onebox.response'))
- end
-
- it "translates the URL" do
- @o.translate_url.should == "https://api.github.com/repos/discourse/discourse/commits/ee76f1926defa8309b3a7ea64a25707519529a13"
- end
-end
diff --git a/spec/components/oneboxer/github_pullrequest_onebox_spec.rb b/spec/components/oneboxer/github_pullrequest_onebox_spec.rb
deleted file mode 100644
index 378b8531609..00000000000
--- a/spec/components/oneboxer/github_pullrequest_onebox_spec.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-require 'spec_helper'
-require 'oneboxer'
-require 'oneboxer/github_pullrequest_onebox'
-
-describe Oneboxer::GithubPullrequestOnebox do
- describe '#translate_url' do
- it 'returns the api url for the given pull request' do
- onebox = described_class.new(
- 'https://github.com/discourse/discourse/pull/988'
- )
- expect(onebox.translate_url).to eq(
- 'https://api.github.com/repos/discourse/discourse/pulls/988'
- )
- end
- end
-end
-
diff --git a/spec/components/oneboxer/handlebars_onebox_spec.rb b/spec/components/oneboxer/handlebars_onebox_spec.rb
deleted file mode 100644
index 6d1c50f5e42..00000000000
--- a/spec/components/oneboxer/handlebars_onebox_spec.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-require 'spec_helper'
-require 'oneboxer'
-require 'oneboxer/handlebars_onebox'
-
-describe Oneboxer::HandlebarsOnebox do
-
- describe 'simple onebox' do
- H = Oneboxer::HandlebarsOnebox
-
- it "is able to render image size when specified" do
- template = H.template_path('simple_onebox')
- result = H.generate_onebox(template, 'image_width' => 100, 'image_height' => 100, image: 'http://my.com/image.png')
-
- result.should =~ /width=/
- result.should =~ /height=/
- end
-
- class SimpleOnebox < Oneboxer::HandlebarsOnebox
- favicon 'stackexchange.png'
-
- def parse(html)
- { testing: true }
- end
- end
-
- it "does not use fingerprint on favicons" do
- onebox = SimpleOnebox.new "http://domain.com"
- onebox.stubs(:fetch_html).returns("")
- ActionController::Base.helpers.expects(:asset_path).with('favicons/stackexchange.png', digest: false)
- result = onebox.onebox
- end
-
- end
-
-end
diff --git a/spec/components/oneboxer/rottentomatoes_onebox_spec.rb b/spec/components/oneboxer/rottentomatoes_onebox_spec.rb
deleted file mode 100644
index 1cbd10d1f9a..00000000000
--- a/spec/components/oneboxer/rottentomatoes_onebox_spec.rb
+++ /dev/null
@@ -1,115 +0,0 @@
-# encoding: utf-8
-
-require 'spec_helper'
-require 'oneboxer'
-require 'oneboxer/rottentomatoes_onebox'
-
-describe Oneboxer::RottentomatoesOnebox do
- it 'translates the URL' do
- o = Oneboxer::RottentomatoesOnebox.new('http://www.rottentomatoes.com/m/mud_2012/')
- expect(o.translate_url).to eq('http://rottentomatoes.com/mobile/m/mud_2012/')
- end
-
- it 'generates the expected onebox for a fresh movie' do
- o = Oneboxer::RottentomatoesOnebox.new('http://www.rottentomatoes.com/m/mud_2012/')
- FakeWeb.register_uri(:get, o.translate_url, response: fixture_file('oneboxer/rottentomatoes_fresh.response'))
- o.onebox.should match_html expected_fresh_result
- end
-
- it 'generates the expected onebox for a rotten movie' do
- o = Oneboxer::RottentomatoesOnebox.new('http://www.rottentomatoes.com/m/the_big_wedding_2013/')
- FakeWeb.register_uri(:get, o.translate_url, response: fixture_file('oneboxer/rottentomatoes_rotten.response'))
- o.onebox.should match_html expected_rotten_result
- end
-
- it 'generates the expected onebox for a movie with an incomplete description' do
- o = Oneboxer::RottentomatoesOnebox.new('http://www.rottentomatoes.com/m/gunde_jaari_gallanthayyinde/')
- FakeWeb.register_uri(:get, o.translate_url, response: fixture_file('oneboxer/rottentomatoes_incomplete.response'))
- o.onebox.should match_html expected_incomplete_result
- end
-
-private
- def expected_fresh_result
- <
-
-
- 98% of critics liked it.
- 85% of users liked it.
- Cast: Matthew McConaughey, Reese Witherspoon
- Director: Jeff Nichols
- Theater Release: Apr 26, 2013
- Running Time: 2 hr. 10 min.
- Rated: PG-13
- Mud is an adventure about two boys, Ellis and his friend Neckbone, who find a man named Mud hiding out on an island in the Mississippi. Mud describes fantastic scenarios-he killed a man in Texas and vengeful bounty hunters are coming to get him. He says he is planning to meet and escape with the love of his life, Juniper, who is waiting for him in town. Skeptical but i...
-
-
- 6% of critics liked it.
- 80% of users liked it.
- Cast: Robert De Niro, Diane Keaton
- Director: Justin Zackham
- Theater Release: Apr 26, 2013
- Running Time: 1 hr. 29 min.
- Rated: R
- With an all-star cast led by Robert De Niro, Katherine Heigl, Diane Keaton, Amanda Seyfried, Topher Grace, with Susan Sarandon and Robin Williams, THE BIG WEDDING is an uproarious romantic comedy about a charmingly modern family trying to survive a weekend wedding celebration that has the potential to become a full blown family fiasco. To the amusement of their adult c...
-
-
-
-
- Cast: Nithin, Nithya Menon
- Director: Vijay Kumar Konda
- Theater Release: Apr 19, 2013
- Running Time: 2 hr. 35 min.
- Rated: Unrated
- Software engineer Karthik thinks he is the smartest guy on the earth, but he turns out be the biggest fool at the end.
-
-
-
-EXPECTED
- end
-end
diff --git a/spec/components/oneboxer/stack_exchange_onebox_spec.rb b/spec/components/oneboxer/stack_exchange_onebox_spec.rb
deleted file mode 100644
index edf182d4a43..00000000000
--- a/spec/components/oneboxer/stack_exchange_onebox_spec.rb
+++ /dev/null
@@ -1,73 +0,0 @@
-require 'spec_helper'
-
-describe Oneboxer::StackExchangeOnebox do
- describe '#translate_url' do
- let(:question) { '15622543' }
- let(:api_url) {
- "http://api.stackexchange.com/2.1/questions/#{question}?site=#{site}"
- }
-
- context 'when the question is from Stack Overflow' do
- let(:site) { 'stackoverflow' }
-
- it 'returns the correct api url for an expanded url' do
- onebox = described_class.new([
- "http://#{site}.com/",
- "questions/#{question}/discourse-ruby-2-0-rails-4"
- ].join)
-
- expect(onebox.translate_url).to eq api_url
- end
-
- it 'returns the correct api url for a share url' do
- onebox = described_class.new("http://#{site}.com/q/#{question}")
-
- expect(onebox.translate_url).to eq api_url
- end
- end
-
- context 'when the question is from Super User' do
- let(:site) { 'superuser' }
-
- it 'returns the correct api url' do
- onebox = described_class.new("http://#{site}.com/q/#{question}")
-
- expect(onebox.translate_url).to eq api_url
- end
- end
-
- context 'when the question is from Meta Stack Overflow' do
- let(:site) { 'meta.stackoverflow' }
-
- it 'returns the correct api url' do
- onebox = described_class.new("http://meta.stackoverflow.com/q/#{question}")
-
- expect(onebox.translate_url).to eq api_url
- end
- end
-
- context 'when the question is from a Meta Stack Exchange subdomain' do
- let(:site) { 'meta.gamedev' }
-
- it 'returns the correct api url' do
- onebox = described_class.new("http://meta.gamedev.stackexchange.com/q/#{question}")
-
- expect(onebox.translate_url).to eq api_url
- end
-
- end
-
- context 'when the question is from a Stack Exchange subdomain' do
- let(:site) { 'gamedev' }
-
- it 'returns the correct api url' do
- onebox = described_class.new([
- "http://#{site}.stackexchange.com/",
- "questions/#{question}/how-to-prevent-the-too-awesome-to-use-syndrome"
- ].join)
-
- expect(onebox.translate_url).to eq api_url
- end
- end
- end
-end
diff --git a/spec/components/oneboxer/twitter_onebox_spec.rb b/spec/components/oneboxer/twitter_onebox_spec.rb
deleted file mode 100644
index b65e2d73952..00000000000
--- a/spec/components/oneboxer/twitter_onebox_spec.rb
+++ /dev/null
@@ -1,56 +0,0 @@
-require 'spec_helper'
-
-describe Oneboxer::TwitterOnebox do
- subject { described_class.new(nil, nil) }
-
- let(:data) { %({ "text":"#{text}", "created_at":"#{created_at}" }) }
-
- let(:text) { '' }
- let(:created_at) { '2013-06-13T22:37:05Z' }
-
- describe '#parse' do
- it 'formats the timestamp' do
- expect(subject.parse(data)['created_at']).to eq '10:37PM - 13 Jun 13'
- end
-
- context 'when text contains a url' do
- let(:text) { 'Twitter http://twitter.com' }
-
- it 'wraps eack url in a link' do
- expect(subject.parse(data)['text']).to eq([
- "Twitter ",
- '',
- "http://twitter.com",
- ""
- ].join)
- end
- end
-
- context 'when the text contains a twitter handle' do
- let(:text) { 'I like @chrishunt' }
-
- it 'wraps each handle in a link' do
- expect(subject.parse(data)['text']).to eq([
- "I like ",
- "",
- "@chrishunt",
- ""
- ].join)
- end
- end
-
- context 'when the text contains a hashtag' do
- let(:text) { 'No secrets. #NSA' }
-
- it 'wraps each hashtag in a link' do
- expect(subject.parse(data)['text']).to eq([
- "No secrets. ",
- "",
- "#NSA",
- ""
- ].join)
- end
- end
- end
-end
-
diff --git a/spec/components/oneboxer/whitelist_spec.rb b/spec/components/oneboxer/whitelist_spec.rb
deleted file mode 100644
index bfc181cd0c7..00000000000
--- a/spec/components/oneboxer/whitelist_spec.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-require 'spec_helper'
-require 'oneboxer'
-require 'oneboxer/whitelist'
-
-describe Oneboxer::Whitelist do
- it "matches an arbitrary Discourse post link" do
- Oneboxer::Whitelist.entry_for_url('http://meta.discourse.org/t/scrolling-up-not-loading-in-firefox/3340/6?123').should_not be_nil
- end
-
- it "matches an arbitrary Discourse topic link" do
- Oneboxer::Whitelist.entry_for_url('http://meta.discourse.org/t/scrolling-up-not-loading-in-firefox/3340?123').should_not be_nil
- end
-
- it "Does not match on slight variation" do
- Oneboxer::Whitelist.entry_for_url('http://meta.discourse.org/t/scrolling-up-not-loading-in-firefox/3340a?123').should be_nil
- end
-
-end
diff --git a/spec/components/oneboxer/wikipedia_onebox_spec.rb b/spec/components/oneboxer/wikipedia_onebox_spec.rb
deleted file mode 100644
index 8bcb7987421..00000000000
--- a/spec/components/oneboxer/wikipedia_onebox_spec.rb
+++ /dev/null
@@ -1,57 +0,0 @@
-# encoding: utf-8
-
-require 'spec_helper'
-require 'oneboxer'
-require 'oneboxer/wikipedia_onebox'
-
-describe Oneboxer::WikipediaOnebox do
-
- it "generates the expected onebox for Wikipedia" do
- o = Oneboxer::WikipediaOnebox.new('http://en.wikipedia.org/wiki/Ruby')
- 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'))
- o.onebox.should match_html expected_wikipedia_result
- end
-
- it "accepts .com extention" do
- o = Oneboxer::WikipediaOnebox.new('http://en.wikipedia.com/wiki/Postgres')
- o.translate_url.should == 'http://en.m.wikipedia.org/w/index.php?title=Postgres'
- end
-
- it "encodes identifier" do
- o = Oneboxer::WikipediaOnebox.new('http://en.wikipedia.com/wiki/Café')
- o.translate_url.should == 'http://en.m.wikipedia.org/w/index.php?title=Caf%C3%A9'
- end
-
- it "defaults to en locale" do
- o = Oneboxer::WikipediaOnebox.new('http://wikipedia.org/wiki/Ruby_on_rails')
- o.translate_url.should == 'http://en.m.wikipedia.org/w/index.php?title=Ruby_on_rails'
- end
-
- it "generates localized url" do
- o = Oneboxer::WikipediaOnebox.new('http://fr.wikipedia.org/wiki/Ruby')
- o.translate_url.should == 'http://fr.m.wikipedia.org/w/index.php?title=Ruby'
- end
-
-private
- def expected_wikipedia_result
- <
-
-
- A ruby is a pink to blood-red colored gemstone, a variety of the mineral corundum (aluminium oxide). The red color is caused mainly by the presence of the element chromium. Its name comes from ruber, Latin for red. Other varieties of gem-quality corundum are called sapphires. The ruby is considered one of the four precious stones, together with the sapphire, the emerald, and the diamond. Prices of rubies are primarily determined by color. The brightest and most valuable "red" called pigeon blood-...
-
-
-
-EXPECTED
- end
-end
diff --git a/spec/components/oneboxer_spec.rb b/spec/components/oneboxer_spec.rb
deleted file mode 100644
index 086790b14d5..00000000000
--- a/spec/components/oneboxer_spec.rb
+++ /dev/null
@@ -1,206 +0,0 @@
-require 'spec_helper'
-require 'oneboxer'
-
-describe "Dynamic Oneboxer" do
- class DummyDynamicOnebox < Oneboxer::BaseOnebox
- matcher do
- /^https?:\/\/dummy2.localhost/
- end
-
- def onebox
- "dummy2!"
- end
- end
-
- before do
- Oneboxer.add_onebox DummyDynamicOnebox
- @dummy_onebox_url = "http://dummy2.localhost/dummy-object"
- end
-
- context 'find onebox for url' do
-
- it 'returns blank with an unknown url' do
- Oneboxer.onebox_for_url('http://asdfasdfasdfasdf.asdf').should be_blank
- end
-
- it 'returns something when matched' do
- Oneboxer.onebox_for_url(@dummy_onebox_url).should be_present
- end
-
- it 'returns an instance of our class when matched' do
- Oneboxer.onebox_for_url(@dummy_onebox_url).kind_of?(DummyDynamicOnebox).should be_true
- end
-
- end
-
-end
-
-describe Oneboxer do
-
- # A class to help us test
- class DummyOnebox < Oneboxer::BaseOnebox
- matcher /^https?:\/\/dummy.localhost/
-
- def onebox
- "dummy!"
- end
- end
-
- let(:dummy_onebox_url) { "http://dummy.localhost/dummy-object" }
-
- before do
- Oneboxer.add_onebox DummyOnebox
- end
-
- it 'should have matchers set up by default' do
- Oneboxer.matchers.should be_present
- end
-
- context 'caching' do
-
- let(:result) { "onebox result string" }
-
- context "with invalidate_oneboxes true" do
-
- it "invalidates the url" do
- Oneboxer.expects(:invalidate).with(dummy_onebox_url)
- Oneboxer.onebox(dummy_onebox_url, invalidate_oneboxes: true)
- end
-
- it "doesn't render from cache" do
- Oneboxer.expects(:render_from_cache).never
- Oneboxer.onebox(dummy_onebox_url, invalidate_oneboxes: true)
- end
-
- it "calls fetch and cache" do
- Oneboxer.expects(:fetch_and_cache).returns(result)
- Oneboxer.onebox(dummy_onebox_url, invalidate_oneboxes: true).should == result
- end
-
- end
-
- context 'with invalidate_oneboxes false' do
-
- it "doesn't invalidate the url" do
- Oneboxer.expects(:invalidate).with(dummy_onebox_url).never
- Oneboxer.onebox(dummy_onebox_url, invalidate_oneboxes: false)
- end
-
- it "returns render_from_cache if present" do
- Oneboxer.expects(:render_from_cache).with(dummy_onebox_url).returns(result)
- Oneboxer.onebox(dummy_onebox_url, invalidate_oneboxes: false).should == result
- end
-
- it "doesn't call fetch_and_cache" do
- Oneboxer.expects(:render_from_cache).with(dummy_onebox_url).returns(result)
- Oneboxer.expects(:fetch_and_cache).never
- Oneboxer.onebox(dummy_onebox_url, invalidate_oneboxes: false)
- end
-
-
- it "calls fetch_and_cache if render from cache is blank" do
- Oneboxer.stubs(:render_from_cache)
- Oneboxer.expects(:fetch_and_cache).returns(result)
- Oneboxer.onebox(dummy_onebox_url, invalidate_oneboxes: false).should == result
- end
-
- end
-
- end
-
- context 'find onebox for url' do
-
- it 'returns blank with an unknown url' do
- Oneboxer.onebox_for_url('http://asdfasdfasdfasdf.asdf').should be_blank
- end
-
- it 'returns something when matched' do
- Oneboxer.onebox_for_url(dummy_onebox_url).should be_present
- end
-
- it 'returns an instance of our class when matched' do
- Oneboxer.onebox_for_url(dummy_onebox_url).kind_of?(DummyOnebox).should be_true
- end
-
- end
-
- describe '#nice_host' do
- it 'strips www from the domain' do
- DummyOnebox.new('http://www.cnn.com/thing').nice_host.should eq 'cnn.com'
- end
-
- it 'respects double TLDs' do
- DummyOnebox.new('http://news.bbc.co.uk/thing').nice_host.should eq 'news.bbc.co.uk'
- end
-
- it 'returns an empty string if the URL is bogus' do
- DummyOnebox.new('whatever').nice_host.should eq ''
- end
-
- it 'returns an empty string if the URL unparsable' do
- DummyOnebox.new(nil).nice_host.should eq ''
- end
- end
-
- context 'without caching' do
- it 'calls the onebox method of our matched class' do
- Oneboxer.onebox_nocache(dummy_onebox_url).should == 'dummy!'
- end
- end
-
- context 'each_onebox_link' do
-
- before do
- @html = "Discourse Link"
- end
-
- it 'yields each url and element when given a string' do
- result = Oneboxer.each_onebox_link(@html) do |url, element|
- element.is_a?(Nokogiri::XML::Element).should be_true
- url.should == 'http://discourse.org'
- end
- result.kind_of?(Nokogiri::HTML::DocumentFragment).should be_true
- end
-
- it 'yields each url and element when given a doc' do
- doc = Nokogiri::HTML(@html)
- Oneboxer.each_onebox_link(doc) do |url, element|
- element.is_a?(Nokogiri::XML::Element).should be_true
- url.should == 'http://discourse.org'
- end
- end
-
- end
-
- context "apply_onebox" do
- it "is able to nuke wrapping p" do
- doc = Oneboxer.apply "
"
- doc = Oneboxer.apply orig do |url, element|
- nil
- end
-
- doc.changed? == false
- doc.to_html.should match_html orig
- end
-
- it "does not strip if there is a br in same node" do
- doc = Oneboxer.apply "
" if url == "http://bla.com"
- end
-
- doc.changed? == true
- doc.to_html.should match_html "
foo
"
- end
-
- end
-
-end
diff --git a/spec/components/post_revisor_spec.rb b/spec/components/post_revisor_spec.rb
index b615ce3adeb..8279c4802e0 100644
--- a/spec/components/post_revisor_spec.rb
+++ b/spec/components/post_revisor_spec.rb
@@ -191,7 +191,9 @@ describe PostRevisor do
before do
SiteSetting.stubs(:newuser_max_images).returns(0)
- subject.revise!(changed_by, "So, post them here!\nhttp://i.imgur.com/FGg7Vzu.gif")
+ url = "http://i.imgur.com/wfn7rgU.jpg"
+ Oneboxer.stubs(:onebox).with(url, anything).returns("")
+ subject.revise!(changed_by, "So, post them here!\n#{url}")
end
it "allows an admin to insert images into a new user's post" do
@@ -209,11 +211,11 @@ describe PostRevisor do
SiteSetting.stubs(:newuser_max_images).returns(0)
url = "http://i.imgur.com/FGg7Vzu.gif"
# this test is problamatic, it leaves state in the onebox cache
- Oneboxer.invalidate(url)
+ Oneboxer.stubs(:onebox).with(url, anything).returns("")
subject.revise!(post.user, "So, post them here!\n#{url}")
end
- it "allows an admin to insert images into a new user's post" do
+ it "doesn't allow images to be inserted" do
post.errors.should be_present
end