From f21691efb5de2b6cafa64b07b8e0fb2cb399244d Mon Sep 17 00:00:00 2001 From: Philip Arndt Date: Thu, 29 Nov 2012 08:54:50 +1300 Subject: Prevent post_spec.rb from hanging the entire spec run for 30 seconds while it tries to retrieve external resources. --- spec/models/refinery/blog/post_spec.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'spec') diff --git a/spec/models/refinery/blog/post_spec.rb b/spec/models/refinery/blog/post_spec.rb index 7b0c9be..84e9c87 100644 --- a/spec/models/refinery/blog/post_spec.rb +++ b/spec/models/refinery/blog/post_spec.rb @@ -197,7 +197,7 @@ module Refinery end end end - + describe "source url" do it "should allow a source url and title" do p = FactoryGirl.create(:blog_post, :source_url => 'google.com', :source_url_title => 'author') @@ -206,13 +206,15 @@ module Refinery p.source_url_title.should include('author') end end - + describe ".validate_source_url?" do context "with Refinery::Blog.validate_source_url set to true" do before do Refinery::Blog.validate_source_url = true - end + end it "should have canonical url" do + UrlValidator.any_instance.should_receive(:resolve_redirects_verify_url). + and_return('http://www.google.com') p = FactoryGirl.create(:blog_post, :source_url => 'google.com', :source_url_title => 'google') p.source_url.should include('www') end @@ -227,7 +229,7 @@ module Refinery end end end - + end end end -- cgit v1.2.3