diff options
Diffstat (limited to 'spec/controllers/application_controller_spec.rb')
-rw-r--r-- | spec/controllers/application_controller_spec.rb | 8 |
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 |