From 8365808466eb5beb5a0ac64a4b68db3fef39cd43 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Wed, 1 Aug 2012 15:21:31 +0100 Subject: Add before and after methods to isolate any effect these tests have on locale. --- spec/controllers/services_controller_spec.rb | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'spec/controllers/services_controller_spec.rb') diff --git a/spec/controllers/services_controller_spec.rb b/spec/controllers/services_controller_spec.rb index 2be382258..a701ae247 100644 --- a/spec/controllers/services_controller_spec.rb +++ b/spec/controllers/services_controller_spec.rb @@ -2,8 +2,15 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe ServicesController, "when using web services" do + integrate_views - + + # store and restore the locale in the context of the test suite to isolate + # changes made in these tests + before do + @old_locale = FastGettext.locale() + end + it "should show no alaveteli message when in the deployed country" do config = MySociety::Config.load_default() config['ISO_COUNTRY_CODE'] = "DE" @@ -29,5 +36,8 @@ describe ServicesController, "when using web services" do response.body.should match(/Puede hacer solicitudes de información en España/) end + after do + FastGettext.set_locale(@old_locale) + end -end +end \ No newline at end of file -- cgit v1.2.3