aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers
diff options
context:
space:
mode:
authorSeb Bacon <seb.bacon@gmail.com>2012-01-18 11:07:50 +0000
committerSeb Bacon <seb.bacon@gmail.com>2012-01-18 11:07:50 +0000
commit46a8ec0fae82f8bc74077c4754b35aa0bd9a5ccd (patch)
treed1d9db41c32315c0ca77fa56dfca42253740507f /spec/controllers
parent936c3b2fb1365e46239ff98ab962460d0c459730 (diff)
Fix more test breakage
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/application_controller_spec.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/spec/controllers/application_controller_spec.rb b/spec/controllers/application_controller_spec.rb
index 8c3730a7e..2e0e99200 100644
--- a/spec/controllers/application_controller_spec.rb
+++ b/spec/controllers/application_controller_spec.rb
@@ -2,6 +2,12 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
require 'fakeweb'
describe ApplicationController, "when accessing third party services" do
+ before (:each) do
+ FakeWeb.clean_registry
+ end
+ after (:each) do
+ FakeWeb.clean_registry
+ end
it "should succeed if the service responds OK" do
config = MySociety::Config.load_default()
config['GAZE_URL'] = 'http://denmark.com'
@@ -22,7 +28,7 @@ describe ApplicationController, "when accessing third party services" do
country.should == config['ISO_COUNTRY_CODE']
end
it "should fail silently if the country_from_ip service returns an error" do
- FakeWeb.register_uri(:get, %r|http://500.com|, :body => "Error", :status => ["500", "Error"])
+ FakeWeb.register_uri(:get, %r|500.com|, :body => "Error", :status => ["500", "Error"])
config = MySociety::Config.load_default()
config['GAZE_URL'] = 'http://500.com'
country = self.controller.send :country_from_ip