From 46a8ec0fae82f8bc74077c4754b35aa0bd9a5ccd Mon Sep 17 00:00:00 2001 From: Seb Bacon Date: Wed, 18 Jan 2012 11:07:50 +0000 Subject: Fix more test breakage --- spec/controllers/application_controller_spec.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'spec/controllers/application_controller_spec.rb') 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 -- cgit v1.2.3